diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2017-10-24 19:44:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-24 19:44:00 (GMT) |
commit | 03e724e1a31a29bca29101e7554f973535e5f855 (patch) | |
tree | 3db3ab9b9b531d99499b011c38266d28ff6d6720 /src/markdown.cpp | |
parent | 929ea15c46c55562862181f59ae2c6b00c046dc0 (diff) | |
parent | e4596c7eab90ba4d307e2c212cefeab8ac820269 (diff) | |
download | Doxygen-03e724e1a31a29bca29101e7554f973535e5f855.zip Doxygen-03e724e1a31a29bca29101e7554f973535e5f855.tar.gz Doxygen-03e724e1a31a29bca29101e7554f973535e5f855.tar.bz2 |
Merge pull request #142 from randomguy3/line-breaks
Implement "double-space line breaks" syntax in Markdown
Diffstat (limited to 'src/markdown.cpp')
-rw-r--r-- | src/markdown.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp index 42ec49d..1cd06e5 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -1865,6 +1865,16 @@ static int writeTableBlock(GrowBuf &out,const char *data,int size) } +static int hasLineBreak(const char *data,int size) +{ + int i=0; + while (i<size && data[i]!='\n') i++; + if (i>=size) return 0; // empty line + if (i<2) return 0; // not long enough + return (data[i-1]==' ' && data[i-2]==' '); +} + + void writeOneLineHeaderOrRuler(GrowBuf &out,const char *data,int size) { int level; @@ -1938,6 +1948,10 @@ void writeOneLineHeaderOrRuler(GrowBuf &out,const char *data,int size) else // nothing interesting -> just output the line { out.addStr(data,size); + if (hasLineBreak(data,size)) + { + out.addStr("<br>"); + } } } |