diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-08-05 13:35:47 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-08-05 13:35:47 (GMT) |
commit | 0fa3bc21d2e2d81e57a84e6ccbbe00d5e371179b (patch) | |
tree | 2f430fcd3675ad7577530aa54176b0cf30dd36da /src/markdown.cpp | |
parent | 5a2e70a9cde99f6a065d78ad550ed386cdcc83f1 (diff) | |
download | Doxygen-0fa3bc21d2e2d81e57a84e6ccbbe00d5e371179b.zip Doxygen-0fa3bc21d2e2d81e57a84e6ccbbe00d5e371179b.tar.gz Doxygen-0fa3bc21d2e2d81e57a84e6ccbbe00d5e371179b.tar.bz2 |
Fix for markdown emphasis processing regression.
Prevent <TT>__BLA</TT> .... <TT>BLA__</TT> from being detected as an
emphasis section and causing the wrong output.
Diffstat (limited to 'src/markdown.cpp')
-rw-r--r-- | src/markdown.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp index 86727a9..458e295 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -159,7 +159,7 @@ int Trace::s_indent = 0; // is character at position i in data an escape that prevents ending an emphasis section // so for example *bla (*.txt) is cool* #define ignoreCloseEmphChar(i) \ - (data[i]=='(' || data[i]=='{' || data[i]=='[' || data[i]=='<' || \ + (data[i]=='(' || data[i]=='{' || data[i]=='[' || (data[i]=='<' && data[i+1]!='/') || \ data[i]=='\\' || \ data[i]=='@') @@ -356,12 +356,13 @@ int Markdown::findEmphasisChar(const char *data, int size, char c, int c_size) { while (i<size && data[i]!=c && data[i]!='`' && data[i]!='\\' && data[i]!='@' && + !(data[i]=='/' && data[i-1]=='<') && // html end tag also ends emphasis data[i]!='\n') i++; //printf("findEmphasisChar: data=[%s] i=%d c=%c\n",data,i,data[i]); // not counting escaped chars or characters that are unlikely // to appear as the end of the emphasis char - if (i>0 && ignoreCloseEmphChar(i-1)) + if (ignoreCloseEmphChar(i-1)) { i++; continue; @@ -430,6 +431,10 @@ int Markdown::findEmphasisChar(const char *data, int size, char c, int c_size) i++; } } + else if (data[i-1]=='<' && data[i]=='/') // html end tag invalidates emphasis + { + return 0; + } else if (data[i]=='\n') // end * or _ at paragraph boundary { i++; |