diff options
Diffstat (limited to 'src/markdown.cpp')
-rw-r--r-- | src/markdown.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp index 9b3232e..33a471a 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -2686,12 +2686,13 @@ QCString markdownFileNameToId(const QCString &fileName) int i = baseFn.findRev('.'); if (i!=-1) baseFn = baseFn.left(i); QCString baseName = baseFn; - baseName = substitute(baseName,":","_"); - baseName = substitute(baseName,"/","_"); - baseName = substitute(baseName,".","_"); - baseName = substitute(baseName," ","_"); - baseName = substitute(baseName,"+","_"); - baseName = substitute(baseName,"@","_"); + char *p = baseName.rawData(); + char c; + while ((c=*p)) + { + if (!isId(c)) *p='_'; // escape characters that do not yield an identifier by underscores + p++; + } //printf("markdownFileNameToId(%s)=md_%s\n",qPrint(fileName),qPrint(baseName)); return "md_"+baseName; } |