diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2019-12-22 20:25:16 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2019-12-22 20:25:16 (GMT) |
commit | 0bf44109f64f7a6cec82d03a1f97779a51f0fdda (patch) | |
tree | 5f2037fb06f02782191a402330100f168eb3f40e | |
parent | 5d6f6b9971ab484fe811feba940200a31876a213 (diff) | |
parent | 4e2a1ac22f27046f16acc95ea7d763a67bb7f344 (diff) | |
download | Doxygen-0bf44109f64f7a6cec82d03a1f97779a51f0fdda.zip Doxygen-0bf44109f64f7a6cec82d03a1f97779a51f0fdda.tar.gz Doxygen-0bf44109f64f7a6cec82d03a1f97779a51f0fdda.tar.bz2 |
Merge branch 'feature/bug_nbsp_code' of https://github.com/albert-github/doxygen into albert-github-feature/bug_nbsp_code
-rw-r--r-- | src/markdown.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp index 12fce3b..d63492e 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -108,7 +108,8 @@ static Entry *g_current; static QCString g_fileName; static int g_lineNr; static int g_indentLevel=0; // 0 is outside markdown, -1=page level - +static char g_doxynbsputf8[3] = {'\xc2', '\xa0', '\0'}; // UTF-8 nbsp +static char *g_doxynbsp = "&_doxy_nbsp;"; //---------- const int codeBlockIndent = 4; @@ -1044,7 +1045,7 @@ static int processSpecialCommand(GrowBuf &out, const char *data, int offset, int if (qstrncmp(&data[i+1],endBlockName,l)==0) { //printf("found end at %d\n",i); - out.addStr(data,i+1+l); + out.addStr(substitute(QCString(data).left(i+1+l),g_doxynbsp,g_doxynbsputf8)); return i+1+l; } } @@ -2174,7 +2175,7 @@ static void writeFencedCodeBlock(GrowBuf &out,const char *data,const char *lng, { out.addStr("{"+lang+"}"); } - out.addStr(data+blockStart,blockEnd-blockStart); + out.addStr(substitute(QCString(data+blockStart).left(blockEnd-blockStart),g_doxynbsp,g_doxynbsputf8)); out.addStr("\n"); out.addStr("@endcode\n"); } @@ -2484,7 +2485,7 @@ static QCString detab(const QCString &s,int &refIndent) // special handling of the UTF-8 nbsp character 0xc2 0xa0 if (c == '\xc2' && data[i] == '\xa0') { - out.addStr(" "); + out.addStr(g_doxynbsp); i++; } else @@ -2561,7 +2562,7 @@ QCString processMarkdown(const QCString &fileName,const int lineNr,Entry *e,cons processInline(out,s,s.length()); out.addChar(0); Debug::print(Debug::Markdown,0,"======== Markdown =========\n---- input ------- \n%s\n---- output -----\n%s\n=========\n",qPrint(input),qPrint(out.get())); - return out.get(); + return substitute(out.get(),g_doxynbsp," "); } //--------------------------------------------------------------------------- |