aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/content-parser.c4
-rw-r--r--tests/check_content_parser.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/content-parser.c b/src/content-parser.c
index 8821a17..e5bb16c 100644
--- a/src/content-parser.c
+++ b/src/content-parser.c
@@ -193,11 +193,11 @@ blogc_content_parse_inline(const char *src)
break;
}
if (state == LINK_CLOSED || state == LINK_IMAGE) {
+ if (state == LINK_CLOSED)
+ start_state = current;
state = LINK_TEXT;
start = current + 1;
open_bracket = 0;
- if (state == LINK_CLOSED)
- start_state = current;
break;
}
if (state == LINK_TEXT) {
diff --git a/tests/check_content_parser.c b/tests/check_content_parser.c
index cb497cb..1eb2aa5 100644
--- a/tests/check_content_parser.c
+++ b/tests/check_content_parser.c
@@ -727,13 +727,13 @@ test_content_parse_inline(void **state)
{
char *html = blogc_content_parse_inline(
"**bola***asd* [![lol](http://google.com/lol.png) **lol** "
- "\\[asd\\]\\(qwe\\)](http://google.com) ``chunda`` [[bola]]");
+ "\\[asd\\]\\(qwe\\)](http://google.com) ``chunda`` [[bola]] chunda[9]");
assert_non_null(html);
assert_string_equal(html,
"<strong>bola</strong><em>asd</em> "
"<a href=\"http://google.com\"><img src=\"http://google.com/lol.png\" "
"alt=\"lol\"> <strong>lol</strong> [asd](qwe)</a> "
- "<code>chunda</code> <a href=\"bola\">bola</a>");
+ "<code>chunda</code> <a href=\"bola\">bola</a> chunda[9]");
free(html);
html = blogc_content_parse_inline("*bola*");
assert_non_null(html);