aboutsummaryrefslogtreecommitdiffstats
path: root/Untitled.txt
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-11 17:54:10 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-11 17:54:10 +0200
commitdb5a491e6c2223d1db9b458307431a54db3c40f2 (patch)
treee8ce1244a83bd0eb7099740bae292852f6155c98 /Untitled.txt
parent0d9c4611922535533746d1a86f10ef4e701c950e (diff)
downloadmarkdown-rs-db5a491e6c2223d1db9b458307431a54db3c40f2.tar.gz
markdown-rs-db5a491e6c2223d1db9b458307431a54db3c40f2.tar.bz2
markdown-rs-db5a491e6c2223d1db9b458307431a54db3c40f2.zip
Refactor `readme.md`
Diffstat (limited to 'Untitled.txt')
-rw-r--r--Untitled.txt28
1 files changed, 28 insertions, 0 deletions
diff --git a/Untitled.txt b/Untitled.txt
index e796b86..8238cf7 100644
--- a/Untitled.txt
+++ b/Untitled.txt
@@ -2,3 +2,31 @@ micromark.js: unquoted: is `completeAttributeValueUnquoted`s case for `completeA
micromark.js: `]` case in cdata_end does not need to consume, it can defer to `cdata_close`, which should save 1 line
micromark.js: should `tagOpenAttributeValueUnquoted` also support a slash?
micromark.js: `atLineEnding` in html (text) should always eat arbitrary whitespace? code (indented) has no effect on html (text)?
+
+```rs
+// ---------------------
+// 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 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;
+}
+```