aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/string.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-18 18:33:10 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-18 18:33:17 +0200
commit25e267afbc0789ea36508d45c3ea3545b84223bb (patch)
tree8dee2a78ad1df29e9df7cf151091a5d265fd7ecb /src/construct/string.rs
parent1dbf02d8c1955316c6cc43a427f506b91c87ef3a (diff)
downloadmarkdown-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.rs7
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),