summaryrefslogtreecommitdiffstats
path: root/src/markdown.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2016-02-07 15:59:31 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2016-02-07 16:03:57 (GMT)
commitef56187f733d946e4df130d9783eadea41ec1c97 (patch)
tree58189fd5dab1de7c31a6c67b9da4b2cbec9349fa /src/markdown.cpp
parent0fead5249b8ef2c3c5cbbbd712855bae877aa27b (diff)
downloadDoxygen-ef56187f733d946e4df130d9783eadea41ec1c97.zip
Doxygen-ef56187f733d946e4df130d9783eadea41ec1c97.tar.gz
Doxygen-ef56187f733d946e4df130d9783eadea41ec1c97.tar.bz2
Fixed issue escaping ndashes (\--) and mdashes (\---)
Diffstat (limited to 'src/markdown.cpp')
-rw-r--r--src/markdown.cpp27
1 files changed, 11 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;
}