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 /Untitled.txt | |
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 '')
-rw-r--r-- | Untitled.txt | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/Untitled.txt b/Untitled.txt index 8238cf7..ca56d67 100644 --- a/Untitled.txt +++ b/Untitled.txt @@ -7,26 +7,22 @@ micromark.js: `atLineEnding` in html (text) should always eat arbitrary whitespa // --------------------- // Useful helper: -let mut index = 0; -let mut balance = 0; -println!("before: {:?}", events.len()); -while index < events.len() { - let event = &events[index]; - if event.event_type == EventType::Exit { - balance -= 1; + let mut index = 0; + let mut balance = 0; + println!("before: {:?}", tokenizer.events.len()); + while index < tokenizer.events.len() { + let event = &tokenizer.events[index]; + if event.kind == Kind::Exit { + balance -= 1; + } + let prefix = String::from_utf8(vec![b' '; balance * 2]).unwrap(); + println!( + "ev: {}{:?}:{:?} ({:?}): {:?}", + prefix, event.kind, event.name, index, event.link, + ); + if event.kind == Kind::Enter { + balance += 1; + } + index += 1; } - let prefix = String::from_utf8(vec![b' '; balance * 2]).unwrap(); - println!( - "ev: {}{:?}:{:?} ({:?}): {:?}", - prefix, - event.kind, - event.name, - index, - event.link, - ); - if event.event_type == EventType::Enter { - balance += 1; - } - index += 1; -} ``` |