diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2015-10-18 09:54:51 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2015-10-20 20:02:51 (GMT) |
commit | 59a42f974f15fa0154317900ffd9b82babd985ad (patch) | |
tree | dd042d5bf1bc71517c1162a2ef1cedf3a2edf5dc /src | |
parent | 02454d98dee441c3485575afe8a9de707ddaa5c7 (diff) | |
download | Doxygen-59a42f974f15fa0154317900ffd9b82babd985ad.zip Doxygen-59a42f974f15fa0154317900ffd9b82babd985ad.tar.gz Doxygen-59a42f974f15fa0154317900ffd9b82babd985ad.tar.bz2 |
Bug 756724 - Inline markdown links don't support reference targets that contain )
Diffstat (limited to 'src')
-rw-r--r-- | src/markdown.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp index 02d1416..9ff139c 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -695,14 +695,26 @@ static int processLink(GrowBuf &out,const char *data,int,int size) if (i<size && data[i]=='<') i++; linkStart=i; nl=0; - while (i<size && data[i]!='\'' && data[i]!='"' && data[i]!=')') + int braceCount=1; + while (i<size && data[i]!='\'' && data[i]!='"' && braceCount>0) { - if (data[i]=='\n') + if (data[i]=='\n') // unexpected EOL { nl++; if (nl>1) return 0; } - i++; + else if (data[i]=='(') + { + braceCount++; + } + else if (data[i]==')') + { + braceCount--; + } + if (braceCount>0) + { + i++; + } } if (i>=size || data[i]=='\n') return 0; convertStringFragment(link,data+linkStart,i-linkStart); @@ -720,7 +732,7 @@ static int processLink(GrowBuf &out,const char *data,int,int size) nl=0; while (i<size && data[i]!=')') { - if (data[i]=='\n') + if (data[i]=='\n') { if (nl>1) return 0; nl++; |