summaryrefslogtreecommitdiffstats
path: root/src/markdown.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-10-17 11:36:03 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2020-10-17 11:36:03 (GMT)
commit7573677d7b20b17799cc80d09cc7322f8cf53f8d (patch)
treea7e73b334cfd658414d53772be9f99ee088f7fa2 /src/markdown.cpp
parent0b069049a176c4f8970f271e698489d9fc7d1da7 (diff)
parent111905bdbc511434bd909f8f8dc0cf6c63620d43 (diff)
downloadDoxygen-7573677d7b20b17799cc80d09cc7322f8cf53f8d.zip
Doxygen-7573677d7b20b17799cc80d09cc7322f8cf53f8d.tar.gz
Doxygen-7573677d7b20b17799cc80d09cc7322f8cf53f8d.tar.bz2
Merge branch 'master' of github.com:doxygen/doxygen
Diffstat (limited to 'src/markdown.cpp')
-rw-r--r--src/markdown.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp
index 15e18bc..c72537b 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -808,6 +808,7 @@ int Markdown::processLink(const char *data,int,int size)
}
contentStart=i;
int level=1;
+ int nlTotal=0;
int nl=0;
// find the matching ]
while (i<size)
@@ -831,6 +832,8 @@ int Markdown::processLink(const char *data,int,int size)
}
i++;
}
+ nlTotal += nl;
+ nl = 0;
if (i>=size) return 0; // premature end of comment -> no link
contentEnd=i;
convertStringFragment(content,data+contentStart,contentEnd-contentStart);
@@ -843,9 +846,12 @@ int Markdown::processLink(const char *data,int,int size)
if (i<size && data[i]=='\n') // one newline allowed here
{
i++;
+ nl++;
// skip more whitespace
while (i<size && data[i]==' ') i++;
}
+ nlTotal += nl;
+ nl = 0;
bool explicitTitle=FALSE;
if (i<size && data[i]=='(') // inline link
@@ -854,7 +860,6 @@ int Markdown::processLink(const char *data,int,int size)
while (i<size && data[i]==' ') i++;
if (i<size && data[i]=='<') i++;
linkStart=i;
- nl=0;
int braceCount=1;
while (i<size && data[i]!='\'' && data[i]!='"' && braceCount>0)
{
@@ -876,6 +881,8 @@ int Markdown::processLink(const char *data,int,int size)
i++;
}
}
+ nlTotal += nl;
+ nl = 0;
if (i>=size || data[i]=='\n') return 0;
convertStringFragment(link,data+linkStart,i-linkStart);
link = link.stripWhiteSpace();
@@ -985,6 +992,8 @@ int Markdown::processLink(const char *data,int,int size)
{
return 0;
}
+ nlTotal += nl;
+ nl = 0;
if (isToc) // special case for [TOC]
{
int toc_level = Config_getInt(TOC_INCLUDE_HEADINGS);
@@ -1066,6 +1075,7 @@ int Markdown::processLink(const char *data,int,int size)
m_out.addStr("<a href=\"");
m_out.addStr(link);
m_out.addStr("\"");
+ for (int i = 0; i < nlTotal; i++) m_out.addStr("\n");
if (!title.isEmpty())
{
m_out.addStr(" title=\"");