summaryrefslogtreecommitdiffstats
path: root/src/markdown.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2020-11-03 19:15:27 (GMT)
committeralbert-github <albert.tests@gmail.com>2020-11-03 19:15:27 (GMT)
commiteaf691cc82cb2c819bf61a48265d334464f2d831 (patch)
treefb53d37006b404141dae199951e3381620121f5f /src/markdown.cpp
parent67132b86a0d24cafab0fa400b1433f908efd4113 (diff)
downloadDoxygen-eaf691cc82cb2c819bf61a48265d334464f2d831.zip
Doxygen-eaf691cc82cb2c819bf61a48265d334464f2d831.tar.gz
Doxygen-eaf691cc82cb2c819bf61a48265d334464f2d831.tar.bz2
issue #8156 Markdown anchors do not work with special symbols
Replace the respective characters by an underscore.
Diffstat (limited to 'src/markdown.cpp')
-rw-r--r--src/markdown.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp
index 4abe10e..9b3232e 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -2685,7 +2685,13 @@ QCString markdownFileNameToId(const QCString &fileName)
QCString baseFn = stripFromPath(QFileInfo(fileName).absFilePath().utf8());
int i = baseFn.findRev('.');
if (i!=-1) baseFn = baseFn.left(i);
- QCString baseName = substitute(substitute(substitute(substitute(baseFn," ","_"),"/","_"),":","_"),"@","_");
+ QCString baseName = baseFn;
+ baseName = substitute(baseName,":","_");
+ baseName = substitute(baseName,"/","_");
+ baseName = substitute(baseName,".","_");
+ baseName = substitute(baseName," ","_");
+ baseName = substitute(baseName,"+","_");
+ baseName = substitute(baseName,"@","_");
//printf("markdownFileNameToId(%s)=md_%s\n",qPrint(fileName),qPrint(baseName));
return "md_"+baseName;
}