aboutsummaryrefslogtreecommitdiffstats
path: root/src/content-parser.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-05-18 19:12:00 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-05-18 19:12:00 -0300
commitcbefb0ffb583a877a082bc336f2d61be7e773a5d (patch)
treeb1df898f575c32d77a0939eda0af02d336143802 /src/content-parser.c
parentae19d4d1d14efee57afe85ba90048e81120ec68a (diff)
downloadblogc-cbefb0ffb583a877a082bc336f2d61be7e773a5d.tar.gz
blogc-cbefb0ffb583a877a082bc336f2d61be7e773a5d.tar.bz2
blogc-cbefb0ffb583a877a082bc336f2d61be7e773a5d.zip
content-parser: fix and test horizontal rules
Diffstat (limited to 'src/content-parser.c')
-rw-r--r--src/content-parser.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/content-parser.c b/src/content-parser.c
index aa4db79..f412810 100644
--- a/src/content-parser.c
+++ b/src/content-parser.c
@@ -548,6 +548,8 @@ blogc_content_parse(const char *src)
case CONTENT_UNORDERED_LIST_OR_HORIZONTAL_RULE:
if (c == d) {
+ if (is_last)
+ goto hr;
state = CONTENT_HORIZONTAL_RULE;
break;
}
@@ -558,9 +560,10 @@ blogc_content_parse(const char *src)
break;
case CONTENT_HORIZONTAL_RULE:
- if (c == d) {
+ if (c == d && !is_last) {
break;
}
+hr:
if (c == '\n' || c == '\r' || is_last) {
b_string_append(rv, "<hr />\n");
state = CONTENT_START_LINE;