Age | Commit message (Collapse) | Author | |
---|---|---|---|
2023-09-28 | chore: make assert_char_encoding_independence more readable | Martin Fischer | |
2023-09-28 | chore: rename internal tokenizer helper fn to parser | Martin Fischer | |
2023-09-03 | feat: add Doctype::name_span | Martin Fischer | |
2023-09-03 | refactor: make test_and_annotate test encoding-independence | Martin Fischer | |
2023-09-03 | fix!: make comment data spans encoding-independent | Martin Fischer | |
2023-09-03 | test: test comment data spans more thoroughly | Martin Fischer | |
2023-09-03 | fix: make doctype id spans encoding-independent | Martin Fischer | |
2023-09-03 | fix!: make set_self_closing encoding-independent | Martin Fischer | |
2023-09-03 | fix!: make attribute spans encoding-independent | Martin Fischer | |
2023-09-03 | fix!: make start/end tag name spans encoding-independent | Martin Fischer | |
2023-09-03 | fix: don't assume UTF-8 in machine/tokenizer | Martin Fischer | |
2023-09-03 | test: verify that span logic incorrectly assumes UTF-8 | Martin Fischer | |
2023-09-03 | refactor: make span tests tokenizer-independent | Martin Fischer | |
2023-09-03 | refactor: let comment and doctype tests check multiple cases | Martin Fischer | |
2023-09-03 | fix: too small char ref error spans | Martin Fischer | |
2023-09-03 | test: verify too small char ref error spans | Martin Fischer | |
2023-09-03 | fix: off-by-one missing-semicolon-after-character-reference span | Martin Fischer | |
2023-09-03 | test: verify off-by-one missing-semicolon-after-character-reference span | Martin Fischer | |
2023-09-03 | chore: rename char ref test | Martin Fischer | |
The tests for character reference errors should be grouped together. So this commit puts "char_ref" first in the function name (since our error tests are ordered by function name). | |||
2023-09-03 | fix!: off-by-one end-tag-with-trailing-solidus span | Martin Fischer | |
2023-09-03 | fix: most error spans mistakenly being empty | Martin Fischer | |
With codespan_reporting an empty span shows up exactly like a one-byte span, which is why I didn't notice this mistake earlier. | |||
2023-09-03 | fix: off-by-one eof error spans | Martin Fischer | |
2023-09-03 | test: add span tests for eof errors | Martin Fischer | |
2023-09-03 | fix!: wrong attribute value spans for char refs | Martin Fischer | |
2023-09-03 | test: verify wrong attribute value spans for char refs | Martin Fischer | |
2023-08-19 | feat: introduce NaiveParser | Martin Fischer | |
2023-08-19 | break!: remove DefaultEmitter from public API | Martin Fischer | |
2023-08-19 | chore: switch from pretty_assertions to similar-asserts | Martin Fischer | |
In the next commit I'm adding a test that compares the content of files and pretty_assertions doesn't omit large portions of unchanged lines in its diff[1] (contrary to similar-asserts). (Sidenote: We already depend on similar via insta.) [1]: https://github.com/rust-pretty-assertions/rust-pretty-assertions/issues/114 | |||
2023-08-19 | break!: stop abusing Display for Error codes | Martin Fischer | |
Display impls should return human-readable strings. After this commit we're able to introduce a proper Display impl in the future without that being a breaking change. | |||
2023-08-19 | feat!: add span and offsets to Doctype | Martin Fischer | |
2023-08-19 | fix: report value offset/span as None for the empty attr syntax | Martin Fischer | |
2023-08-19 | break!: introduce AttributeMap | Martin Fischer | |
This has a number of benefits: * it hides the implementation of the map * it hides the type used for the map values (which lets us e.g. change name_span to name_offset while still being able to provide a convenient `Attribute::name_span` method.) * it lets us provide convenience impls for the map such as `FromIterator<(String, String)>` | |||
2023-08-19 | feat!: add all-inclusive spans to tags | Martin Fischer | |
Also more performant since we no longer have to update the name span on every Emitter::push_tag_name call. | |||
2023-08-19 | fix: fix lots of position off-by-ones | Martin Fischer | |
Previously the PosTrackingReader always mysteriously subtracted 1 from the current position ... this wasn't sound at all ... the machine just happens to often call `Tokenizer::unread_char` ... but not always. E.g. for proper comments it didn't which resulted in their offset and spans being off-by-one, which is fixed by this commit (see test_spans.rs). | |||
2023-08-19 | refactor!: make Emitter generic over offset instead of reader | Martin Fischer | |
Emitters should not have access to the reader at all. Also the current position of the reader, at the time an Emitted method is called, very much depends on machine implementation details such as if `Tokenizer::unread_char` is used. Having the Emitter methods take offsets lets the machine take care of providing the right offsets, as evidenced by the next commit. | |||
2023-08-19 | feat!: add offset to comments | Martin Fischer | |
2023-08-19 | refactor!: remove Span trait, just use Range | Martin Fischer | |
`std::mem::size_of::<Range<NoopOffset>>()` is 0 so there's no need to abstract over Range. | |||
2023-08-19 | test: split up span test | Martin Fischer | |
2023-08-19 | break!: merge Tokenizer::new_with_emitter into Tokenizer::new | Martin Fischer | |
The Tokenizer does not perform any state switching, since proper state switching requires a feedback loop between tokenization and DOM tree building. Using the Tokenizer directly therefore is a bit of a pitfall, since you might not expect it to e.g. tokenize `<script><b>` as: StartTag(StartTag { name: "script", .. }) StartTag(StartTag { name: "b", .. }) Since we don't want to make walking into pitfalls particularly easy, this commit changes the Tokenizer::new method so that you have to specify the Emitter. Since this makes new_with_emitter redundant it is removed. | |||
2023-08-19 | break!: privatize PosTrackingReader fields | Martin Fischer | |
2023-08-19 | break!: rename PosTracker to PosTrackingReader | Martin Fischer | |
2023-08-19 | break!: remove InfallibleTokenizer in favor of Iterator::flatten | Martin Fischer | |
2023-08-19 | break!: rename Readable to IntoReader | Martin Fischer | |
The trait of the standard library is also called IntoIterator and not Iterable. | |||
2021-12-05 | rename to html5tokenizer, bump versionv0.4.0 | Martin Fischer | |
2021-12-05 | spans: get rid of code duplication by introducing Span trait | Martin Fischer | |
2021-12-05 | spans: add spans to Token::Error | Martin Fischer | |
2021-12-05 | spans: support attribute names | Martin Fischer | |
2021-12-05 | spans: add span tests | Martin Fischer | |