A \< at the end of the input is exactly the same as \<(space)

This commit is contained in:
david parsons
2012-09-28 10:44:46 -07:00
parent c41feae1ca
commit 5d89faf8ca
2 changed files with 6 additions and 1 deletions
+2 -1
View File
@@ -1337,7 +1337,8 @@ text(MMIOT *f)
case '\\': switch ( c = pull(f) ) {
case '&': Qstring("&amp;", f);
break;
case '<': if ( isspace(peek(f,1)) )
case '<': c = peek(f,1);
if ( (c == EOF) || isspace(c) )
Qstring("&lt;", f);
else {
/* Markdown.pl does not escape <[nonwhite]
+4
View File
@@ -12,5 +12,9 @@ try -fautolink 'autolink url with trailing \' \
'http://a.com/\' \
'<p><a href="http://a.com/\">http://a.com/\</a></p>'
try 'backslashes before <text' '\<code>' '<p>\<code></p>'
try 'backslashes before < (no text)' '\< ' '<p>&lt; </p>'
summary $0
exit $rc