diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2013-10-13 15:31:22 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2013-10-13 15:45:19 (GMT) |
commit | 1a0a120b75c28b515cacb021d48d78c18a18b19b (patch) | |
tree | 2f23c3b0afb9aa9dc09a37d76e3866a15525be20 | |
parent | 6bb9ee4fee7eb850594f89638a492b0c2f60a68d (diff) | |
download | Doxygen-1a0a120b75c28b515cacb021d48d78c18a18b19b.zip Doxygen-1a0a120b75c28b515cacb021d48d78c18a18b19b.tar.gz Doxygen-1a0a120b75c28b515cacb021d48d78c18a18b19b.tar.bz2 |
Allow links to other markdown pages of the form [link text](page.md)
-rw-r--r-- | doc/markdown.doc | 2 | ||||
-rw-r--r-- | src/markdown.cpp | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/doc/markdown.doc b/doc/markdown.doc index 9f70a52..90caebe 100644 --- a/doc/markdown.doc +++ b/doc/markdown.doc @@ -449,7 +449,7 @@ If a page has a label you can link to it using \ref cmdref "\@ref" as is shown above. To refer to a markdown page without such label you can simple use the file name of the page, e.g. - See [the other page](@ref other.md) for more info. + See [the other page](other.md) for more info. \subsection md_html_blocks Treatment of HTML blocks diff --git a/src/markdown.cpp b/src/markdown.cpp index 19c9187..eb5a2a2 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -850,9 +850,15 @@ static int processLink(GrowBuf &out,const char *data,int,int size) } else { - if (link.find("@ref ")!=-1 || link.find("\\ref ")!=-1) + SrcLangExt lang = getLanguageFromFileName(link); + int lp=-1; + if ((lp=link.find("@ref "))!=-1 || (lp=link.find("\\ref "))!=-1 || lang==SrcLangExt_Markdown) // assume doxygen symbol link { + if (lp==-1) // link to markdown page + { + out.addStr("@ref "); + } out.addStr(link); out.addStr(" \""); if (explicitTitle && !title.isEmpty()) |