Changes annotated with ⚠
are breaking.
- Fixes a build error if compiled with the
simd
feature flag. See [#60] - Fixes MDN-related doc comments ([#51])
- Fixes a bug in the query selector parser that made it fail to parse values containing
:
. See y21/tl#46 and [#47] for more details.
- Fixes a build error if compiled with the
simd
feature flag. See y21/tl#41 for more details. - ⚠ In prior versions,
innerHTML()
actually had the behavior ofElement#outerHTML
. This was changed andinnerHTML
now correctly only returns the markup of its subnodes, and not the markup of the own node. outerHTML()
was added to nodes, which moves the old behavior to another function.- Added
children_mut()
, which allows mutating the subnodes of an HTML Tag.
- Fixed a bug that caused the parser to parse closing tags incorrectly. See y21/tl#37 and y21/tl#38 for more details.
- Restructure internals (mainly SIMD functions)
- Add fuzzing targets for internals
- Optimize stable parser (adds stable alternatives when the
simd
feature isn't set)
- Fixed
HTMLTag::raw()
returning one byte less than it should have. See y21/tl#31.
- Add
Attributes::contains(key)
to check if an attribute exists. - Add
Attributes::remove(key)
to remove an attribute. - Add
Attributes::remove_value(key)
to delete the value of a given attribute key.
- Version bump in README.md
Warning: This release contains breaking changes
- ⚠ Function signature of
Attributes::insert
has changed:- It now takes two generic parameters
K, V
instead of just one. Prior to this version, this meant that the key and value type had to match. See y21/tl#27 for more details.
- It now takes two generic parameters
- Added a
TryFrom<String> for Bytes
implementation for convenience to create ownedBytes
. - Added
HTMLTag::boundaries
method for obtaining the start and end position of a tag in the source string. - Fixed a panic when source string abruptly ends with
<tag/
- Fixed a bug where
Attributes::class()
returned its id attribute instead of class. See y21/tl#26
- Fixed a bug where the slash in slash tags (
<br />
) is interpreted as>
and causes the next>
to be interpreted as a text node on its own.
- Fixed an off-by-one error in the
QueryIterable
trait implementation forHTMLTag
that caused query selectors on HTML tags to return one node less than they should.
Warning: This release contains breaking changes
- ⚠ Removed deprecated method
VDom::find_node
- Alternative: use
VDom::nodes().iter().find(...)
instead
- Alternative: use
- ⚠
Attributes::get()
now returns a reference toBytes
instead of cloning.- Prior to this version, it wasn't necessary to return a reference as the
Bytes
type was just an immutable&[u8]
. Now it can hold owned data.
- Prior to this version, it wasn't necessary to return a reference as the
- ⚠
HTMLTag::children()
no longer returns an iterator, and instead returns a wrapper struct around the children of the HTML tag. This wrapper struct makes it easy to obtain direct children of the tag (Children::top()
), or all children (including their children, etc...) (Children::all()
). - ⚠
Node::children()
no longer returns an iterator (see above). - ⚠
HTMLTag::name()
now returns a reference toBytes
instead of cloning (see above). - Ability to create/parse query selectors independent of any parser (
tl::parse_query_selector
) - Ability to reuse query selectors
- Ability to apply query selectors on
HTMLTag
s (see #18) queryselector
module is now publicInnerNodeHandle
is now u32- Remove unused
max_depth
parser option - Add convenience
PartialEq<str>
andPartialEq<[u8]>
impls for Bytes
Warning: This release contains breaking changes
- Allow
Bytes
to store owned data throughBytes::set()
- ⚠ The maximum length for
Bytes
isu32::MAX
- ⚠ The maximum length for
- ⚠
tl::parse()
now returnsResult<VDom<'a>, ParseError>
- ⚠
Attributes
fields are no longer public, instead use one of the provided methods - ⚠
HTMLTag::inner_html()
now takes a&Parser
and no longer directly returns the substring- Node mutations to the tag or any of its subnodes means
inner_html
needs to be recomputed - Consider using
HTMLTag::raw()
if you never mutate any nodes
- Node mutations to the tag or any of its subnodes means
- Parse unquoted attribute values properly (
<a href=foo>
) [#12] - Parse valueless attributes properly (
<iframe allowfullscreen>
) [#11]
- Add optional
simd
feature flag for SIMD-accelerated parsing
- Keep track of recursion depth when parsing to avoid overflowing the stack
- Fixed an infinite loop bug in
parse_single
and a panic that occurs when trying to parse incomplete markup tags (<!
)
- Remove
AsBytes
trait in favor ofFrom<T> for Bytes
- Add
VDom::query_selector()
- Introduce
InnerHandleNode
to hide implementation details ofNodeHandle
- Make
Attributes::is_class_member()
generic overT: Into<Bytes<'a>>
- Add
Attributes::get_attribute()
- Make
HTMLTag::name()
andHTMLTag::inner_html()
return ownedBytes
- Deprecate
VDom::find_node
in favor ofVDom::nodes().iter().find()