diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-05-18 19:12:00 -0300 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-05-18 19:12:00 -0300 |
commit | cbefb0ffb583a877a082bc336f2d61be7e773a5d (patch) | |
tree | b1df898f575c32d77a0939eda0af02d336143802 /src/content-parser.c | |
parent | ae19d4d1d14efee57afe85ba90048e81120ec68a (diff) | |
download | blogc-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.c | 5 |
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; |