diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2016-05-26 20:02:40 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2016-05-26 20:02:40 (GMT) |
commit | 5f9d80b2ce73a7e7fb0f4fc16f3ef5fee0cf8105 (patch) | |
tree | d52224717f14c588930d64370ce6f07b74a7744e /src | |
parent | b00761b30a1d399f95adfe823937c05a64476155 (diff) | |
download | Doxygen-5f9d80b2ce73a7e7fb0f4fc16f3ef5fee0cf8105.zip Doxygen-5f9d80b2ce73a7e7fb0f4fc16f3ef5fee0cf8105.tar.gz Doxygen-5f9d80b2ce73a7e7fb0f4fc16f3ef5fee0cf8105.tar.bz2 |
Bug 751416 - Markdown: > escaped within backticks
Diffstat (limited to 'src')
-rw-r--r-- | src/markdown.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp index 5b0ede9..84e52ba 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -111,19 +111,21 @@ static void processInline(GrowBuf &out,const char *data,int size); static QCString escapeSpecialChars(const QCString &s) { if (s.isEmpty()) return ""; + bool insideQuote=FALSE; GrowBuf growBuf; const char *p=s; - char c; + char c,pc='\0'; while ((c=*p++)) { switch (c) { - case '<': growBuf.addStr("\\<"); break; - case '>': growBuf.addStr("\\>"); break; - case '\\': growBuf.addStr("\\\\"); break; - case '@': growBuf.addStr("\\@"); break; - default: growBuf.addChar(c); break; + case '"': if (pc!='\\') { insideQuote=!insideQuote; } growBuf.addChar(c); break; + case '<': if (!insideQuote) { growBuf.addChar('\\'); } growBuf.addChar('<'); break; + case '>': if (!insideQuote) { growBuf.addChar('\\'); } growBuf.addChar('>'); break; + case '@': if (!insideQuote) { growBuf.addChar('\\'); } growBuf.addChar('@'); break; + default: growBuf.addChar(c); break; } + pc=c; } growBuf.addChar(0); return growBuf.get(); |