diff options
author | albert-github <albert.tests@gmail.com> | 2020-05-21 10:31:58 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2020-05-21 10:31:58 (GMT) |
commit | 01068088e4fa0f1ea5d202fcd78109aaf45fcdb2 (patch) | |
tree | 2f1a59347d1043ae56690b0fd432ac7f6bcefa51 | |
parent | a2133a44d353997af904299c73f267a94eb6f9b9 (diff) | |
download | Doxygen-01068088e4fa0f1ea5d202fcd78109aaf45fcdb2.zip Doxygen-01068088e4fa0f1ea5d202fcd78109aaf45fcdb2.tar.gz Doxygen-01068088e4fa0f1ea5d202fcd78109aaf45fcdb2.tar.bz2 |
issue #7595 Links from one Markdown file to another do not work
- the not linking in case of a the relative path (as there was no anchor for it)
- (on windows) the created, internal, anchor for a file can contain a `:` but this is not possible in an anchor and has to be escaped.
-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"); } } |