aboutsummaryrefslogtreecommitdiffstats
path: root/src/parser.rs (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-09-14Fix to prefer flow over definitions, setext headingsLibravatar Titus Wormer1-7/+16
An undocumented part of CommonMark is how to deal with things in definition labels or definition titles (which both can span multiple lines). Can flow (or containers?) interrupt them? They can according to the `cmark` reference parser, so this was implemented here. This adds a new `Content` content type, which houses zero or more definitions, and then zero-or-one paragraphs. Content can be followed by a setext heading underline, which either turns into a setext heading when the content ends in a paragraph, or turns into the start of the following paragraph when it is followed by content that starts with a paragraph, or turns into a stray paragraph.
2022-09-07Add support for recoverable syntax errorsLibravatar Titus Wormer1-4/+4
2022-08-25Add support for GFM footnotesLibravatar Titus Wormer1-2/+8
2022-08-22Add support for GFM strikethroughLibravatar Titus Wormer1-3/+4
2022-08-16Add `no_std + alloc`Libravatar Titus Wormer1-0/+1
2022-08-15Refactor to proof docs, grammarsLibravatar Titus Wormer1-1/+1
2022-08-15Refactor to move some things to `parser`Libravatar Titus Wormer1-3/+18
2022-08-12Refactor to improve docs of each functionLibravatar Titus Wormer1-3/+3
2022-08-11Refactor to move some code to `event.rs`Libravatar Titus Wormer1-1/+1
2022-07-29Refactor to improve statesLibravatar Titus Wormer1-3/+2
* Remove custom kind wrappers, use plain bytes instead * Remove `Into`s, use the explicit expected types instead * Refactor to use `slice.as_str` in most places * Remove unneeded unique check before adding a definition * Use a shared CDATA prefix in constants * Inline byte checks into matches * Pass bytes back from parser instead of whole parse state * Refactor to work more often on bytes * Rename custom `size` to `len`
2022-07-29Refactor to work on bytes (`u8`)Libravatar Titus Wormer1-4/+4
2022-07-28Refactor to work on `char`sLibravatar Titus Wormer1-7/+7
Previously, a custom char implementation was used. This was easier to work with, as sometimes “virtual” characters are injected, or characters are ignored. This replaces that with working on actual `char`s. In the hope of in the future working on `u8`s, even. This simplifies the state machine somewhat, as only `\n` is fed, regardless of whether it was a CRLF, CR, or LF. It also feeds `' '` instead of virtual spaces. The BOM, if present, is now available as a `ByteOrderMark` event.
2022-07-21Refactor to move `index` field to `point`Libravatar Titus Wormer1-1/+1
2022-07-19Remove a couple of clonesLibravatar Titus Wormer1-4/+4
2022-07-19Replace use of `HashSet` with `vec`Libravatar Titus Wormer1-3/+2
2022-07-18Add support for turning off constructsLibravatar Titus Wormer1-1/+4
2022-07-07Fix some small to dosLibravatar Titus Wormer1-2/+1
2022-07-07Add basic support for block quotesLibravatar Titus Wormer1-2/+2
2022-07-05Refactor to do some to dosLibravatar Titus Wormer1-3/+2
2022-07-05Refactor code styleLibravatar Titus Wormer1-2/+3
2022-07-04Update list of todosLibravatar Titus Wormer1-3/+1
2022-06-29Add support for sharing identifiers, references before definitionsLibravatar Titus Wormer1-6/+14
2022-06-24Add link, images (resource)Libravatar Titus Wormer1-4/+16
This is still some messy code that needs cleaning up, but it adds support for links and images, of the resource kind (`[a](b)`). References (`[a][b]`) are parsed and will soon be supported, but need matching. * Fix bug to pad percent-encoded bytes when normalizing urls * Fix bug with escapes counting as balancing in destination * Add `space_or_tab_one_line_ending`, to parse whitespace including up to one line ending (but not a blank line) * Add `ParserState` to share codes, definitions, etc
2022-06-22Update todoLibravatar Titus Wormer1-0/+2
2022-06-17Add support for definitionsLibravatar Titus Wormer1-1/+0
* Add definitions * Add partials for label, destination, title * Add `go`, to attempt something, and do something else on `ok`
2022-06-09Add basic subtokenization, string content in fenced codeLibravatar Titus Wormer1-2/+10
2022-06-09Refactor to pass more slices aroundLibravatar Titus Wormer1-1/+1