From 60ea06a68f2e355e34b61bf45babc6405bfbfe84 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 26 Jan 2014 15:17:47 +0100 Subject: Bug 722711 - [PATCH] Link refs with no title swallow an extra newline --- src/markdown.cpp | 6 +++--- testing/055/md_055_markdown.xml | 20 ++++++++++++++++++++ testing/055_markdown.md | 16 ++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 testing/055/md_055_markdown.xml create mode 100644 testing/055_markdown.md diff --git a/src/markdown.cpp b/src/markdown.cpp index 85d3c83..fe74610 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -1133,8 +1133,8 @@ static int isLinkRef(const char *data,int size, while (i=size) @@ -1152,6 +1152,7 @@ static int isLinkRef(const char *data,int size, int titleStart=i; // search for end of the line while (i=size) return i; // end of buffer while ref id was found - else if (data[i]=='\n') return i+1; // end of line while ref id was found - else if (eol) return eol; // no optional title found + else if (eol) return eol; // end of line while ref id was found return 0; // invalid link ref } diff --git a/testing/055/md_055_markdown.xml b/testing/055/md_055_markdown.xml new file mode 100644 index 0000000..496685f --- /dev/null +++ b/testing/055/md_055_markdown.xml @@ -0,0 +1,20 @@ + + + + md_055_markdown + 055_markdown + + + Foo + + + Bar + + Some text with a link. + + Baz + + More text + + + diff --git a/testing/055_markdown.md b/testing/055_markdown.md new file mode 100644 index 0000000..39ce574 --- /dev/null +++ b/testing/055_markdown.md @@ -0,0 +1,16 @@ + + +# Foo + +## Bar + +Some text with a [link][1]. + +[1]: http://www.example.com/ + +## Baz + +More text -- cgit v0.12