id = gensub(/^\[([^\n]+)\] ?\[([^\n]*)\].*/, "\\2", 1, line);
if ( ! id ) id = text;
if ( rl_href[id] && rl_title[id] ) {
- return "<a href=\"" rl_href[id] "\" title=\"" rl_title[id] "\">" inline(text) "</a>" inline( substr( line, len + 1) );
+ return "<a href=\"" HTML(rl_href[id]) "\" title=\"" HTML(rl_title[id]) "\">" inline(text) "</a>" inline( substr( line, len + 1) );
} else if ( rl_href[id] ) {
- return "<a href=\"" rl_href[id] "\">" inline(text) "</a>" inline( substr( line, len + 1) );
+ return "<a href=\"" HTML(rl_href[id]) "\">" inline(text) "</a>" inline( substr( line, len + 1) );
} else {
- return "" substr(line, 1, len) inline( substr(line, len + 1) );
+ return "" HTML(substr(line, 1, len)) inline( substr(line, len + 1) );
}
# inline images
id = gensub(/^!\[([^\n]+)\] ?\[([^\n]*)\].*/, "\\2", 1, line);
if ( ! id ) id = text;
if ( rl_href[id] && rl_title[id] ) {
- return "<img src=\"" rl_href[id] "\" alt=\"" HTML(text) "\" title=\"" rl_title[id] "\" />" inline( substr( line, len + 1) );
+ return "<img src=\"" HTML(rl_href[id]) "\" alt=\"" HTML(text) "\" title=\"" HTML(rl_title[id]) "\" />" inline( substr( line, len + 1) );
} else if ( rl_href[id] ) {
- return "<img src=\"" rl_href[id] "\" alt=\"" HTML(text) "\" />" inline( substr( line, len + 1) );
+ return "<img src=\"" HTML(rl_href[id]) "\" alt=\"" HTML(text) "\" />" inline( substr( line, len + 1) );
} else {
- return "" substr(line, 1, len) inline( substr(line, len + 1) );
+ return "" HTML(substr(line, 1, len)) inline( substr(line, len + 1) );
}
# ~~strikeout~~ (pandoc)
# ignore embedded underscores (pandoc, php md)
} else if ( match(line, "^[[:alnum:]](__|_)") ) {
- return substr( line, 1, RLENGTH) inline( substr(line, RLENGTH + 1) );
+ return HTML(substr( line, 1, RLENGTH)) inline( substr(line, RLENGTH + 1) );
# __strong__$
} else if ( match(line, "^__(([^_[:space:]]|" ieu ")|([^_[:space:]]|" ieu ")(" nu "|" ieu ")*([^_[:space:]]|" ieu "))__$") ) {