diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2019-05-18 08:50:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-18 08:50:50 (GMT) |
commit | bfd35110cc752ab3c51929b59ea829068a5a395b (patch) | |
tree | 013504ea6302f3063e79480a86218ffaf7b490f2 /src/markdown.cpp | |
parent | 3b601540297e7bc6bf013cdaa457b7cb8ee99336 (diff) | |
parent | 6d20ed0590618b387d4cf6170b1339bf164ce9e3 (diff) | |
download | Doxygen-bfd35110cc752ab3c51929b59ea829068a5a395b.zip Doxygen-bfd35110cc752ab3c51929b59ea829068a5a395b.tar.gz Doxygen-bfd35110cc752ab3c51929b59ea829068a5a395b.tar.bz2 |
Merge pull request #6983 from albert-github/feature/bug_utf8_nbsp
Special handling of the UTF8 nbsp sequence
Diffstat (limited to 'src/markdown.cpp')
-rw-r--r-- | src/markdown.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp index f2ec22a..8369d66 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(" "); + 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++; } |