diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-05-22 11:04:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-22 11:04:02 (GMT) |
commit | e3470060b067bbb5d949de01758aff491fc804c3 (patch) | |
tree | 2f1a59347d1043ae56690b0fd432ac7f6bcefa51 | |
parent | a2133a44d353997af904299c73f267a94eb6f9b9 (diff) | |
parent | 01068088e4fa0f1ea5d202fcd78109aaf45fcdb2 (diff) | |
download | Doxygen-e3470060b067bbb5d949de01758aff491fc804c3.zip Doxygen-e3470060b067bbb5d949de01758aff491fc804c3.tar.gz Doxygen-e3470060b067bbb5d949de01758aff491fc804c3.tar.bz2 |
Merge pull request #7790 from albert-github/feature/issue_7595
issue #7595 Links from one Markdown file to another do not work
-rw-r--r-- | src/markdown.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp index 937e5e0..b04ab2a 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -2591,7 +2591,7 @@ 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(baseFn," ","_"),"/","_"); + QCString baseName = substitute(substitute(substitute(baseFn," ","_"),"/","_"),":","_"); return "md_"+baseName; } @@ -2658,7 +2658,8 @@ void MarkdownOutlineParser::parseInput(const char *fileName, QCString titleFn = QFileInfo(fileName).baseName().utf8(); QCString fn = QFileInfo(fileName).fileName().utf8(); static QCString mdfileAsMainPage = Config_getString(USE_MDFILE_AS_MAINPAGE); - if (id.isEmpty()) id = markdownFileNameToId(fileName); + bool wasEmpty = id.isEmpty(); + if (wasEmpty) id = markdownFileNameToId(fileName); if (!isExplicitPage(docs)) { if (!mdfileAsMainPage.isEmpty() && @@ -2679,6 +2680,7 @@ void MarkdownOutlineParser::parseInput(const char *fileName, else { if (title.isEmpty()) title = titleFn; + if (!wasEmpty) docs.prepend("@anchor " + markdownFileNameToId(fileName) + "\n"); docs.prepend("@page "+id+" "+title+"\n"); } } |