diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-08-18 18:33:10 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-08-18 18:33:17 +0200 |
commit | 25e267afbc0789ea36508d45c3ea3545b84223bb (patch) | |
tree | 8dee2a78ad1df29e9df7cf151091a5d265fd7ecb /src/construct/string.rs | |
parent | 1dbf02d8c1955316c6cc43a427f506b91c87ef3a (diff) | |
download | markdown-rs-25e267afbc0789ea36508d45c3ea3545b84223bb.tar.gz markdown-rs-25e267afbc0789ea36508d45c3ea3545b84223bb.tar.bz2 markdown-rs-25e267afbc0789ea36508d45c3ea3545b84223bb.zip |
Add support for GFM autolink literals
Diffstat (limited to 'src/construct/string.rs')
-rw-r--r-- | src/construct/string.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/construct/string.rs b/src/construct/string.rs index 698a51d..dba1ac1 100644 --- a/src/construct/string.rs +++ b/src/construct/string.rs @@ -27,7 +27,6 @@ const MARKERS: [u8; 2] = [b'&', b'\\']; /// ^ /// ```` pub fn start(tokenizer: &mut Tokenizer) -> State { - tokenizer.register_resolver(ResolveName::String); tokenizer.tokenize_state.markers = &MARKERS; State::Retry(StateName::StringBefore) } @@ -40,7 +39,11 @@ pub fn start(tokenizer: &mut Tokenizer) -> State { /// ```` pub fn before(tokenizer: &mut Tokenizer) -> State { match tokenizer.current { - None => State::Ok, + None => { + tokenizer.register_resolver(ResolveName::Data); + tokenizer.register_resolver(ResolveName::String); + State::Ok + } Some(b'&') => { tokenizer.attempt( State::Next(StateName::StringBefore), |