summaryrefslogtreecommitdiff
path: root/src/scanners.re
diff options
context:
space:
mode:
authorBen Trask <bentrask@comcast.net>2015-03-20 20:30:20 -0400
committerBen Trask <bentrask@comcast.net>2015-04-07 09:26:07 -0400
commit5a3241c1cec67bbdee20c18b95c5fc0695df5edf (patch)
tree9320b8b9ec5fd385cb3bb553b34ea219b2f8adfb /src/scanners.re
parent0e5a0584cedb329fc7eca1966fe95bd2f4593e7e (diff)
Support for CRLF and CR line endings.
Diffstat (limited to 'src/scanners.re')
-rw-r--r--src/scanners.re26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/scanners.re b/src/scanners.re
index 31cdb4f..9411018 100644
--- a/src/scanners.re
+++ b/src/scanners.re
@@ -140,8 +140,8 @@ int _scan_link_url(const unsigned char *p)
const unsigned char *marker = NULL;
const unsigned char *start = p;
/*!re2c
- [ \n]* [<] ([^<>\n\\\x00] | escaped_char | [\\])* [>] { return (p - start); }
- [ \n]* (reg_char+ | escaped_char | in_parens_nosp)* { return (p - start); }
+ [ \r\n]* [<] ([^<>\r\n\\\x00] | escaped_char | [\\])* [>] { return (p - start); }
+ [ \r\n]* (reg_char+ | escaped_char | in_parens_nosp)* { return (p - start); }
.? { return 0; }
*/
}
@@ -177,19 +177,19 @@ int _scan_atx_header_start(const unsigned char *p)
const unsigned char *marker = NULL;
const unsigned char *start = p;
/*!re2c
- [#]{1,6} ([ ]+|[\n]) { return (p - start); }
+ [#]{1,6} ([ ]+|[\r\n]) { return (p - start); }
.? { return 0; }
*/
}
-// Match sexext header line. Return 1 for level-1 header,
+// Match setext header line. Return 1 for level-1 header,
// 2 for level-2, 0 for no match.
int _scan_setext_header_line(const unsigned char *p)
{
const unsigned char *marker = NULL;
/*!re2c
- [=]+ [ ]* [\n] { return 1; }
- [-]+ [ ]* [\n] { return 2; }
+ [=]+ [ ]* [\r\n] { return 1; }
+ [-]+ [ ]* [\r\n] { return 2; }
.? { return 0; }
*/
}
@@ -202,9 +202,9 @@ int _scan_hrule(const unsigned char *p)
const unsigned char *marker = NULL;
const unsigned char *start = p;
/*!re2c
- ([*][ ]*){3,} [ \t]* [\n] { return (p - start); }
- ([_][ ]*){3,} [ \t]* [\n] { return (p - start); }
- ([-][ ]*){3,} [ \t]* [\n] { return (p - start); }
+ ([*][ ]*){3,} [ \t]* [\r\n] { return (p - start); }
+ ([_][ ]*){3,} [ \t]* [\r\n] { return (p - start); }
+ ([-][ ]*){3,} [ \t]* [\r\n] { return (p - start); }
.? { return 0; }
*/
}
@@ -215,8 +215,8 @@ int _scan_open_code_fence(const unsigned char *p)
const unsigned char *marker = NULL;
const unsigned char *start = p;
/*!re2c
- [`]{3,} / [^`\n\x00]*[\n] { return (p - start); }
- [~]{3,} / [^~\n\x00]*[\n] { return (p - start); }
+ [`]{3,} / [^`\r\n\x00]*[\r\n] { return (p - start); }
+ [~]{3,} / [^~\r\n\x00]*[\r\n] { return (p - start); }
.? { return 0; }
*/
}
@@ -227,8 +227,8 @@ int _scan_close_code_fence(const unsigned char *p)
const unsigned char *marker = NULL;
const unsigned char *start = p;
/*!re2c
- [`]{3,} / [ \t]*[\n] { return (p - start); }
- [~]{3,} / [ \t]*[\n] { return (p - start); }
+ [`]{3,} / [ \t]*[\r\n] { return (p - start); }
+ [~]{3,} / [ \t]*[\r\n] { return (p - start); }
.? { return 0; }
*/
}