summaryrefslogtreecommitdiff
path: root/src/scanners.re
diff options
context:
space:
mode:
Diffstat (limited to 'src/scanners.re')
-rw-r--r--src/scanners.re25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/scanners.re b/src/scanners.re
index b20a954..447147b 100644
--- a/src/scanners.re
+++ b/src/scanners.re
@@ -37,11 +37,11 @@ bufsize_t _scan_at(bufsize_t (*scanner)(const unsigned char *), cmark_chunk *c,
tagname = [A-Za-z][A-Za-z0-9-]*;
- blocktagname = 'address'|'article'|'aside'|'base'|'basefont'|'blockquote'|'body'|'caption'|'center'|'col'|'colgroup'|'dd'|'details'|'dialog'|'dir'|'div'|'dl'|'dt'|'fieldset'|'figcaption'|'figure'|'footer'|'form'|'frame'|'frameset'|'h1'|'h2'|'h3'|'h4'|'h5'|'h6'|'head'|'header'|'hr'|'html'|'iframe'|'legend'|'li'|'link'|'main'|'menu'|'menuitem'|'meta'|'nav'|'noframes'|'ol'|'optgroup'|'option'|'p'|'param'|'section'|'source'|'title'|'summary'|'table'|'tbody'|'td'|'tfoot'|'th'|'thead'|'title'|'tr'|'track'|'ul';
+ blocktagname = 'address'|'article'|'aside'|'base'|'basefont'|'blockquote'|'body'|'caption'|'center'|'col'|'colgroup'|'dd'|'details'|'dialog'|'dir'|'div'|'dl'|'dt'|'fieldset'|'figcaption'|'figure'|'footer'|'form'|'frame'|'frameset'|'h1'|'h2'|'h3'|'h4'|'h5'|'h6'|'head'|'header'|'hr'|'html'|'iframe'|'legend'|'li'|'link'|'main'|'menu'|'menuitem'|'nav'|'noframes'|'ol'|'optgroup'|'option'|'p'|'param'|'section'|'source'|'title'|'summary'|'table'|'tbody'|'td'|'tfoot'|'th'|'thead'|'title'|'tr'|'track'|'ul';
attributename = [a-zA-Z_:][a-zA-Z0-9:._-]*;
- unquotedvalue = [^"'=<>`\x00]+;
+ unquotedvalue = [^ \t\r\n\v\f"'=<>`\x00]+;
singlequotedvalue = ['][^'\x00]*['];
doublequotedvalue = ["][^"\x00]*["];
@@ -215,7 +215,7 @@ bufsize_t _scan_link_title(const unsigned char *p)
/*!re2c
["] (escaped_char|[^"\x00])* ["] { return (bufsize_t)(p - start); }
['] (escaped_char|[^'\x00])* ['] { return (bufsize_t)(p - start); }
- [(] (escaped_char|[^)\x00])* [)] { return (bufsize_t)(p - start); }
+ [(] (escaped_char|[^()\x00])* [)] { return (bufsize_t)(p - start); }
* { return 0; }
*/
}
@@ -253,21 +253,6 @@ bufsize_t _scan_setext_heading_line(const unsigned char *p)
*/
}
-// Scan a thematic break line: "...three or more hyphens, asterisks,
-// or underscores on a line by themselves. If you wish, you may use
-// spaces between the hyphens or asterisks."
-bufsize_t _scan_thematic_break(const unsigned char *p)
-{
- const unsigned char *marker = NULL;
- const unsigned char *start = p;
-/*!re2c
- ([*][ \t]*){3,} [ \t]* [\r\n] { return (bufsize_t)(p - start); }
- ([_][ \t]*){3,} [ \t]* [\r\n] { return (bufsize_t)(p - start); }
- ([-][ \t]*){3,} [ \t]* [\r\n] { return (bufsize_t)(p - start); }
- * { return 0; }
-*/
-}
-
// Scan an opening code fence.
bufsize_t _scan_open_code_fence(const unsigned char *p)
{
@@ -275,7 +260,7 @@ bufsize_t _scan_open_code_fence(const unsigned char *p)
const unsigned char *start = p;
/*!re2c
[`]{3,} / [^`\r\n\x00]*[\r\n] { return (bufsize_t)(p - start); }
- [~]{3,} / [^~\r\n\x00]*[\r\n] { return (bufsize_t)(p - start); }
+ [~]{3,} / [^\r\n\x00]*[\r\n] { return (bufsize_t)(p - start); }
* { return 0; }
*/
}
@@ -299,7 +284,7 @@ bufsize_t _scan_entity(const unsigned char *p)
const unsigned char *marker = NULL;
const unsigned char *start = p;
/*!re2c
- [&] ([#] ([Xx][A-Fa-f0-9]{1,8}|[0-9]{1,8}) |[A-Za-z][A-Za-z0-9]{1,31} ) [;]
+ [&] ([#] ([Xx][A-Fa-f0-9]{1,6}|[0-9]{1,7}) |[A-Za-z][A-Za-z0-9]{1,31} ) [;]
{ return (bufsize_t)(p - start); }
* { return 0; }
*/