@@ -1005,13 +1005,18 @@ static void source_pos(test_batch_runner *runner) {
1005
1005
">\n"
1006
1006
"> 2. Yes, okay.\n"
1007
1007
"> \n"
1008
- "<!-- HTML Comment -->" ;
1008
+ "<!-- HTML Comment -->\n"
1009
+ "\n"
1010
+ "what happens if we spread a link [across multiple\n"
1011
+ "lines][anchor]\n"
1012
+ "\n"
1013
+ "[anchor]: http://example.com\n" ;
1009
1014
1010
1015
cmark_node * doc = cmark_parse_document (markdown , sizeof (markdown ) - 1 , CMARK_OPT_DEFAULT );
1011
1016
char * xml = cmark_render_xml (doc , CMARK_OPT_DEFAULT | CMARK_OPT_SOURCEPOS );
1012
1017
STR_EQ (runner , xml , "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
1013
1018
"<!DOCTYPE document SYSTEM \"CommonMark.dtd\">\n"
1014
- "<document sourcepos=\"1:1-11:21 \" xmlns=\"http://commonmark.org/xml/1.0\">\n"
1019
+ "<document sourcepos=\"1:1-16:28 \" xmlns=\"http://commonmark.org/xml/1.0\">\n"
1015
1020
" <heading sourcepos=\"1:1-1:13\" level=\"1\">\n"
1016
1021
" <text sourcepos=\"1:3-1:5\" xml:space=\"preserve\">Hi </text>\n"
1017
1022
" <emph sourcepos=\"1:6-1:12\">\n"
@@ -1055,6 +1060,14 @@ static void source_pos(test_batch_runner *runner) {
1055
1060
" </block_quote>\n"
1056
1061
" <html_block sourcepos=\"11:1-11:21\" xml:space=\"preserve\"><!-- HTML Comment -->\n"
1057
1062
"</html_block>\n"
1063
+ " <paragraph sourcepos=\"13:1-14:14\">\n"
1064
+ " <text sourcepos=\"13:1-13:33\" xml:space=\"preserve\">what happens if we spread a link </text>\n"
1065
+ " <link sourcepos=\"13:34-14:14\" destination=\"http://example.com\" title=\"\">\n"
1066
+ " <text sourcepos=\"13:35-13:49\" xml:space=\"preserve\">across multiple</text>\n"
1067
+ " <softbreak />\n"
1068
+ " <text sourcepos=\"14:1-14:5\" xml:space=\"preserve\">lines</text>\n"
1069
+ " </link>\n"
1070
+ " </paragraph>\n"
1058
1071
"</document>\n" ,
1059
1072
"sourcepos are as expected" );
1060
1073
free (xml );
0 commit comments