X-Git-Url: http://git.plutz.net/?p=cgilite;a=blobdiff_plain;f=markdown.awk;h=4f18b9ba499685017a6fcef4ab25c5a5a581c392;hp=63bb044e8a69c13a87c58c71194ecceaf9b381b8;hb=a8a5ea58ca40e57165c37d62b61fdf1c60832c7d;hpb=ffe17caf6f15242bc1c0e2681d4aa5f46e15f378 diff --git a/markdown.awk b/markdown.awk index 63bb044..4f18b9b 100755 --- a/markdown.awk +++ b/markdown.awk @@ -154,11 +154,15 @@ function inline( line, LOCAL, len, code, href, guard ) { return "" href "" inline( substr( line, len + 1) ); # inline links - } else if ( match(line, /^\[([^]]+)\]\(([^"\)]+)([[:space:]]+"([^"]+)")?\)/) ) { + # ,_______________________Image____________________________, + } else if ( match(line, /^\[([^]]+|!\[[^]]+\]\([^"\)]+([ \t]+"[^"]+")?\)(\{[a-zA-Z \t-]*\})?)\]\(([^"\)]+)([[:space:]]+"([^"]+)")?\)/) ) { len = RLENGTH; - text = gensub(/^\[([^]]+)\]\(([^"\)]+)([[:space:]]+"([^"]+)")?\)/, "\\1", 1, substr(line, 1, len) ); - href = gensub(/^\[([^]]+)\]\(([^"\)]+)([[:space:]]+"([^"]+)")?\)/, "\\2", 1, substr(line, 1, len) ); - title = gensub(/^\[([^]]+)\]\(([^"\)]+)([[:space:]]+"([^"]+)")?\)/, "\\4", 1, substr(line, 1, len) ); + text = gensub(/^\[([^]]+|!\[[^]]+\]\([^"\)]+([ \t]+"[^"]+")?\)(\{[a-zA-Z \t-]*\})?)\]\(([^"\)]+)([[:space:]]+"([^"]+)")?\)/, \ + "\\1", 1, substr(line, 1, len) ); + href = gensub(/^\[([^]]+|!\[[^]]+\]\([^"\)]+([ \t]+"[^"]+")?\)(\{[a-zA-Z \t-]*\})?)\]\(([^"\)]+)([[:space:]]+"([^"]+)")?\)/, \ + "\\4", 1, substr(line, 1, len) ); + title = gensub(/^\[([^]]+|!\[[^]]+\]\([^"\)]+([ \t]+"[^"]+")?\)(\{[a-zA-Z \t-]*\})?)\]\(([^"\)]+)([[:space:]]+"([^"]+)")?\)/, \ + "\\6", 1, substr(line, 1, len) ); if ( title ) { return "" inline( text ) "" inline( substr( line, len + 1) ); } else {