summaryrefslogtreecommitdiffstats
path: root/src/markdown.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/markdown.cpp')
-rw-r--r--src/markdown.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp
index 9d2876b..19c9187 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -2249,6 +2249,15 @@ QCString processMarkdown(const QCString &fileName,Entry *e,const QCString &input
//---------------------------------------------------------------------------
+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," ","_"),"/","_");
+ return "md_"+baseName;
+}
+
void MarkdownFileParser::parseInput(const char *fileName,
const char *fileBuf,
Entry *root,
@@ -2270,15 +2279,10 @@ void MarkdownFileParser::parseInput(const char *fileName,
QCString docs = output.data();
QCString id;
QCString title=extractPageTitle(docs,id).stripWhiteSpace();
- //g_correctSectionLevel = !title.isEmpty();
- QCString baseFn = stripFromPath(QFileInfo(fileName).absFilePath().utf8());
- int i = baseFn.findRev('.');
- if (i!=-1) baseFn = baseFn.left(i);
QCString titleFn = QFileInfo(fileName).baseName().utf8();
QCString fn = QFileInfo(fileName).fileName().utf8();
- QCString baseName = substitute(substitute(baseFn," ","_"),"/","_");
static QCString mdfileAsMainPage = Config_getString("USE_MDFILE_AS_MAINPAGE");
- if (id.isEmpty()) id = "md_"+baseName;
+ if (id.isEmpty()) id = markdownFileNameToId(fileName);
if (title.isEmpty()) title = titleFn;
if (fn==mdfileAsMainPage)
{