diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2016-02-07 15:59:31 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2016-02-07 16:03:57 (GMT) |
commit | ef56187f733d946e4df130d9783eadea41ec1c97 (patch) | |
tree | 58189fd5dab1de7c31a6c67b9da4b2cbec9349fa | |
parent | 0fead5249b8ef2c3c5cbbbd712855bae877aa27b (diff) | |
download | Doxygen-ef56187f733d946e4df130d9783eadea41ec1c97.zip Doxygen-ef56187f733d946e4df130d9783eadea41ec1c97.tar.gz Doxygen-ef56187f733d946e4df130d9783eadea41ec1c97.tar.bz2 |
Fixed issue escaping ndashes (\--) and mdashes (\---)
-rw-r--r-- | src/markdown.cpp | 27 | ||||
-rw-r--r-- | testing/055/md_055_markdown.xml | 1 | ||||
-rw-r--r-- | testing/055_markdown.md | 2 |
3 files changed, 14 insertions, 16 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp index 1723d1f..9bee243 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -1018,26 +1018,21 @@ static int processSpecialCommand(GrowBuf &out, const char *data, int offset, int if (size>1 && data[0]=='\\') { char c=data[1]; - if (c=='[' || c==']' || c=='*' || /* c=='+' || c=='-' || c=='.' || */ - c=='!' || c=='(' || c==')' || c=='`' || c=='_') + if (c=='[' || c==']' || c=='*' || c=='!' || c=='(' || c==')' || c=='`' || c=='_') { - if (c=='-' && size>3 && data[2]=='-' && data[3]=='-') // \--- - { - out.addStr(&data[1],3); - return 4; - } - else if (c=='-' && size>2 && data[2]=='-') // \-- - { - out.addStr(&data[1],2); - return 3; - } - else if (c=='-') // \- - { - out.addChar(c); - } out.addChar(data[1]); return 2; } + else if (c=='-' && size>3 && data[2]=='-' && data[3]=='-') // \--- + { + out.addStr(&data[1],3); + return 4; + } + else if (c=='-' && size>2 && data[2]=='-') // \-- + { + out.addStr(&data[1],2); + return 3; + } } return 0; } diff --git a/testing/055/md_055_markdown.xml b/testing/055/md_055_markdown.xml index 4006db8..18df45b 100644 --- a/testing/055/md_055_markdown.xml +++ b/testing/055/md_055_markdown.xml @@ -23,6 +23,7 @@ <para> <ulink url="http://example.com/last-line">Upper-cased reference link on last line</ulink> </para> + <para>Dash - NDash <ndash/> MDash <mdash/> EDash - ENDash -- EMDash --- E3Dash --- </para> </detaileddescription> </compounddef> </doxygen> diff --git a/testing/055_markdown.md b/testing/055_markdown.md index aeb9f1a..375040e 100644 --- a/testing/055_markdown.md +++ b/testing/055_markdown.md @@ -20,3 +20,5 @@ More text [Upper-cased reference link on last line][U] [U]: http://example.com/last-line + +Dash - NDash -- MDash --- EDash \- ENDash \-- EMDash \--- E3Dash \-\-\- |