:- begin_tests(md_span).
:- use_module(prolog/md/md_span).
test(entity):-
md_span_string("&", [\['&']]).
test(special_amp):-
md_span_string("AT&T", [\['AT'],'&',\['T']]).
test(special_lt):-
md_span_string("1<2", [\['1'],'<',\['2']]).
test(special_lt_end):-
md_span_string("1<", [\['1'],'<']).
test(preserve_html):-
md_span_string("abc1", [\["abc1"]]).
test(strong):-
md_span_string("**abc**", [strong([\["abc"]])]).
test(strong_in_text):-
md_span_string("abc **def** ghi", [\["abc "],strong([\["def"]]),\[" ghi"]]).
test(strong_emb_html):-
md_span_string("**abcanchor**", [strong([\["abcanchor"]])]).
test(strong_underscore):-
md_span_string("__abc__", [strong([\["abc"]])]).
test(strong_nonest):-
md_span_string("**__abc__**", [strong([em([\["_abc"]]), \["_"]])]).
test(strong_space):-
md_span_string("** abc**", [strong([\[" abc"]])]).
test(strong_space_underscore):-
md_span_string("__ abc__", [strong([\[" abc"]])]).
test(emphasis):-
md_span_string("*abc*", [em([\["abc"]])]).
test(emphasis_escape):-
md_span_string("abc \\*def\\* ghi", [\["abc "], '*', \["def"], '*', \[" ghi"]]).
test(emphasis_underscore):-
md_span_string("_abc_", [em([\["abc"]])]).
test(no_emphasis):-
md_span_string("* abc*", [\["* abc*"]]).
test(no_emphasis_underscore):-
md_span_string("_ abc_", [\["_ abc_"]]).
test(code_1):-
md_span_string("`p1:- p2, p3.`", [code("p1:- p2, p3.")]).
test(code_1_entities):-
md_span_string("`