aboutsummaryrefslogtreecommitdiffstats
path: root/readme.md
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-01 15:36:38 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-01 15:39:01 +0200
commit41afec1ed898159e1df3bc1157768f2066dd85e5 (patch)
treed497994301b93c49116993198ef8824f6ce68b85 /readme.md
parent09fd0321daae69d52532b4bef762a202efe9a12e (diff)
downloadmarkdown-rs-41afec1ed898159e1df3bc1157768f2066dd85e5.tar.gz
markdown-rs-41afec1ed898159e1df3bc1157768f2066dd85e5.tar.bz2
markdown-rs-41afec1ed898159e1df3bc1157768f2066dd85e5.zip
Make paragraphs really fast
The approach that `micromark-js` takes is as follows: to parse a paragraph, check whether each line starts with something else. If it does, exit, otherwise continue. That is slow, because our actual flow parser does similar things: the work was being done twice. To fix this, this commit introduces parsing each line of a paragraph separately. And finally, when done with flow, combining adjacent paragraphs. This same mechanism is reused for setext headings. Additionally, this commit adds support for interrupting things (or not). E.g., HTML (flow, complete) cannot interrupt paragraphs. Definitions cannot interrupt paragraphs, and connect be interrupted either, but they can follow each other.
Diffstat (limited to '')
-rw-r--r--readme.md9
1 files changed, 3 insertions, 6 deletions
diff --git a/readme.md b/readme.md
index f7847dc..103b201 100644
--- a/readme.md
+++ b/readme.md
@@ -46,11 +46,6 @@ cargo doc --document-private-items
### Some major obstacles
-- [ ] (8) Can paragraphs operate more performantly than checking whether other
- flow constructs start a line, before exiting and actually attempting flow
- constructs?
-- [ ] (3) Interrupting: sometimes flow can or cannot start depending on the
- previous construct (paragraph, definition)
- [ ] (5) Containers: this will be rather messy, and depends a lot on how
subtokenization is solved
- [ ] (3) Concrete constructs: HTML or code (fenced) cannot be “pierced” into by
@@ -132,7 +127,6 @@ cargo doc --document-private-items
#### Parse
-- [ ] (3) Interrupting (html flow complete, definition + code_indented)
- [ ] (5) attention\
test (`character_reference`, `hard_break_escape`, `hard_break_trailing`,
`heading_atx`, `heading_setext`, `html_flow`, `thematic_break`)\
@@ -274,3 +268,6 @@ important.
- [x] (1) Parse initial and final space_or_tab of paragraphs (in string, text)
- [x] (1) Refactor to clean and document `space_or_tab`
- [x] (1) Refactor to clean and document `edit_map`
+- [x] (8) Make paragraphs fast by merging them at the end, not checking whether
+ things interrupt them each line
+- [x] (3) Add support for interrupting (or not)