diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-03-17 11:22:29 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-03-17 13:01:29 -0700 |
commit | a308cf9fd8d116e1235bc5933b9a759f2224ebc9 (patch) | |
tree | 41c0316000fb96c64623887db8a521585758ce85 /src/scanners.re | |
parent | fbb5d9ad8d288a1d3b1abfde7c8660facb3b9b04 (diff) |
Use hand-rolled scanner for thematic break.
Keep track of the last position where a thematic break
failed to match on a line, to avoid rescanning unnecessarily.
See commonmark/cmark#284.
Diffstat (limited to 'src/scanners.re')
-rw-r--r-- | src/scanners.re | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/scanners.re b/src/scanners.re index 4c72cde..447147b 100644 --- a/src/scanners.re +++ b/src/scanners.re @@ -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) { |