summaryrefslogtreecommitdiffstats
path: root/src/markdown.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2019-05-11 12:01:49 (GMT)
committeralbert-github <albert.tests@gmail.com>2019-05-11 12:01:49 (GMT)
commit6d20ed0590618b387d4cf6170b1339bf164ce9e3 (patch)
treea50fcda3b8139003c928584633f1b3cb3303627c /src/markdown.cpp
parentad9af447d77c2899c484ab9ab776667f083db64b (diff)
downloadDoxygen-6d20ed0590618b387d4cf6170b1339bf164ce9e3.zip
Doxygen-6d20ed0590618b387d4cf6170b1339bf164ce9e3.tar.gz
Doxygen-6d20ed0590618b387d4cf6170b1339bf164ce9e3.tar.bz2
Special handling of the UTF8 nbsp sequence
The UTF8 nbsp sequence 0xc2 0xa0 is not seen as a whitespace sequence and not handled properly. This can lead to: ``` warning: found </c> tag without matching <c> ``` when we have e.g. ```e.g. `linux`<br>``` where the space between the `.` and the backtick is actually the UTF8 nbsp sequence Replacing the the UTF8 nbsp sequence with the `&nbsp;` sequence.
Diffstat (limited to 'src/markdown.cpp')
-rw-r--r--src/markdown.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp
index 6b5a894..df1ffe7 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -2453,19 +2453,32 @@ static QCString detab(const QCString &s,int &refIndent)
col++;
break;
default: // non-whitespace => update minIndent
- out.addChar(c);
if (c<0 && i<size) // multibyte sequence
{
- out.addChar(data[i++]); // >= 2 bytes
- if (((uchar)c&0xE0)==0xE0 && i<size)
+ // special handling of the UTF-8 nbsp character 0xc2 0xa0
+ if (c == '\xc2' && data[i] == '\xa0')
{
- out.addChar(data[i++]); // 3 bytes
+ out.addStr("&nbsp;");
+ i++;
}
- if (((uchar)c&0xF0)==0xF0 && i<size)
+ else
{
- out.addChar(data[i++]); // 4 byres
+ out.addChar(c);
+ out.addChar(data[i++]); // >= 2 bytes
+ if (((uchar)c&0xE0)==0xE0 && i<size)
+ {
+ out.addChar(data[i++]); // 3 bytes
+ }
+ if (((uchar)c&0xF0)==0xF0 && i<size)
+ {
+ out.addChar(data[i++]); // 4 byres
+ }
}
}
+ else
+ {
+ out.addChar(c);
+ }
if (col<minIndent) minIndent=col;
col++;
}