aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2016-02-21 16:43:31 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2016-02-21 16:43:31 +0100
commit437ea5b71f7a1f6cd5d09b28259a8e49acab7fbc (patch)
tree29b91419f89c057548935d46771a440a9334ceb9
parent2e62517084aa345181b8def833245053f1033f6f (diff)
downloadblogc-437ea5b71f7a1f6cd5d09b28259a8e49acab7fbc.tar.gz
blogc-437ea5b71f7a1f6cd5d09b28259a8e49acab7fbc.tar.bz2
blogc-437ea5b71f7a1f6cd5d09b28259a8e49acab7fbc.zip
man: tests: minor documentation fix and more test coverage
-rw-r--r--man/blogc-source.7.ronn11
-rw-r--r--tests/check_content_parser.c9
2 files changed, 18 insertions, 2 deletions
diff --git a/man/blogc-source.7.ronn b/man/blogc-source.7.ronn
index 5a0a485..c2c0490 100644
--- a/man/blogc-source.7.ronn
+++ b/man/blogc-source.7.ronn
@@ -203,6 +203,11 @@ Images are defined using the following syntax:
This is an image: ![This is the image alt text](picture.jpg)
+Whitespace characters and new lines are allowed between alt text and image URL:
+
+ This is an image: ![This is the image alt text]
+ (picture.jpg)
+
### Links
Links are defined using the following syntax:
@@ -220,10 +225,12 @@ Links can be combined with images:
[![This is the image alt text](picture.jpg)](https://blogc.rgm.io)
-Whitespace characters and new lines are allowed between alt text and image URL:
+Whitespace characters and new lines are allowed between link text and link URL,
+and between alt text and image URL:
[![This is the image alt text]
- (picture.jpg)](https://blogc.rgm.io)
+ (picture.jpg)]
+ (https://blogc.rgm.io)
### Automatic Links
diff --git a/tests/check_content_parser.c b/tests/check_content_parser.c
index fb56c19..ea069a7 100644
--- a/tests/check_content_parser.c
+++ b/tests/check_content_parser.c
@@ -1621,6 +1621,15 @@ test_content_parse_inline_image(void **state)
"<a href=\"https://blogc.rgm.io\"><img src=\"picture.jpg\" "
"alt=\"This is the image alt text\"></a>");
free(html);
+ html = blogc_content_parse_inline(
+ "[![This is the image alt text]\n"
+ "(picture.jpg)]\n"
+ "(https://blogc.rgm.io)");
+ assert_non_null(html);
+ assert_string_equal(html,
+ "<a href=\"https://blogc.rgm.io\"><img src=\"picture.jpg\" "
+ "alt=\"This is the image alt text\"></a>");
+ free(html);
html = blogc_content_parse_inline("asd ![bola]chunda(1234)");
assert_non_null(html);
assert_string_equal(html, "asd ![bola]chunda(1234)");