# - [x] Images / reference style images
# - [x] <automatic links>
# - [x] backslash escapes
-# - [ ] Verbatim HTML inline
+# - [x] Verbatim HTML inline
+# - [ ] HTML escaping
#
# Extensions - Block elements:
# ----------------------------
} else if ( match(line, /^ \n/) ) {
return "<br />\n" inline( substr(line, RLENGTH + 1) );
+ # Verbatim inline HTML
+ } else if ( match( line, /^(<!--([^-]|-[^-]|--[^>])*-->|<\?([^\?]|\?[^>])*\?>|<![A-Z][^>]*>|<!\[CDATA\[([^\]]|\][^\]]|\]\][^>])*\]\]>|<\/[A-Za-z][A-Za-z0-9-]*[[:space:]]*>|<[A-Za-z][A-Za-z0-9-]*([[:space:]]+[A-Za-z_:][A-Za-z0-9_\.:-]*([[:space:]]*=[[:space:]]*([[:space:]"'=<>`]+|"[^"]*"|'[^']*'))?)*[[:space:]]*\/?>)/) ) {
+ len = RLENGTH;
+ return substr( line, 1, len) inline(substr(line, len + 1));
+
# ``code spans``
} else if ( match( line, /^`+/) ) {
len = RLENGTH
if ( block == "" ) {
return "";
- # HTML #2
- } else if ( match( block, /(^|\n) ? ? ?<!--([^-]|-[^-]|--[^>])*(-->|$)/) ) {
- len = RLENGTH; st = RSTART;
- return _block(substr(block, 1, st - 1)) substr(block, st, len) _block(substr(block, st + len));
-
- # HTML #3
- } else if ( match( block, /(^|\n) ? ? ?<\?([^\?]|\?[^>])*(\?>|$)/) ) {
- len = RLENGTH; st = RSTART;
- return _block(substr(block, 1, st - 1)) substr(block, st, len) _block(substr(block, st + len));
-
- # HTML #4
- } else if ( match( block, /(^|\n) ? ? ?<![A-Z][^>]*(>|$)/) ) {
- len = RLENGTH; st = RSTART;
- return _block(substr(block, 1, st - 1)) substr(block, st, len) _block(substr(block, st + len));
-
- # HTML #5
- } else if ( match( block, /(^|\n) ? ? ?<!\[CDATA\[([^\]]|\][^\]]|\]\][^>])*(\]\]>|$)/) ) {
+ # HTML #2 #3 #4 $5
+ } else if ( match( block, /(^|\n) ? ? ?(<!--([^-]|-[^-]|--[^>])*(-->|$)|<\?([^\?]|\?[^>])*(\?>|$)|<![A-Z][^>]*(>|$)|<!\[CDATA\[([^\]]|\][^\]]|\]\][^>])*(\]\]>|$))/) ) {
len = RLENGTH; st = RSTART;
return _block(substr(block, 1, st - 1)) substr(block, st, len) _block(substr(block, st + len));
return _block(substr(block, 1, st - 1)) substr(block, st, len) _block(substr(block, st + len));
# HTML #7
- } else if ( match( block, /^ ? ? ?(<\/[A-Za-z][A-Za-z0-9-]* \t]*>|<[A-Za-z][A-Za-z0-9-]*([ \t]+[A-Za-z_:][A-Za-z0-9_\.:-]*[ \t]*=[ \t]*([[:space:]"'=<>`]+|"[^"]*"|'[^']*'))*[ \t]*\/?>)([[:space:]]*\n)([^\n]|\n[[:space:]]*[^\n])*(\n[ \t]*\n|$)/) ) {
+ } else if ( match( block, /^ ? ? ?(<\/[A-Za-z][A-Za-z0-9-]*[[:space:]]*>|<[A-Za-z][A-Za-z0-9-]*([[:space:]]+[A-Za-z_:][A-Za-z0-9_\.:-]*([[:space:]]*=[[:space:]]*([[:space:]"'=<>`]+|"[^"]*"|'[^']*'))?)*[[:space:]]*\/?>)([[:space:]]*\n)([^\n]|\n[ \t]*[^\n])*(\n[[:space:]]*\n|$)/) ) {
len = RLENGTH; st = RSTART;
return substr(block, st, len) _block(substr(block, st + len));