- Add
replace_with()
method inEditable
trait in #14 by @lomirus. - Improve autocomplete performance in
try_parse
from O(n!) to O(n^2) in #16 by @lomirus.
Same as v0.6.0, as the v0.6.0 was yanked for mis-publishing of the wrong commit.
- Add
Node::as_element()
in #8 by @arduano. - Add
Node::as_element_mut()
in #8 by @arduano. - Add
Element::into_node()
in #8 by @arduano. - Add
Queryable::query_mut()
in #8 by @arduano. - Add
Queryable::execute_for()
in #8 by @arduano. - Implement
From<Element>
forNode
in #8 by @arduano. - Derive
Clone
trait forElement
in #8 by @arduano. - Support grouping selectors (e.g.
h1, h2
)in #7 by @lomirus.
- Refactor
Node::Element { name, attr, children }
intoNode::Element(Element)
in #8 by @arduano. - Remove
Node::into_element(self)
in #8 by @arduano. - Implement
From<&str>
instead of ordinary trait method forSelector
@lomirus.
- Improve the performance (3~10 times faster) when parsing large html file by @lomirus.
- Failed to parse tags with whitespaces inside (exclude
<div\n></div>
and<div\t></div>
.
- Fixed that the selector doesn't work for multiple class element by @lomirus in #4;
- Add
try_parse
method for the html with tolerable errors by @lomirus in #2; - Add support for parsing xml doctype by @lomirus in #3;
- Add associated
Doctype
variant toNode::Doctype
to distinguish between html and xml by @lomirus.
- Remove
prelude
module, and replace it withoperation
module by @lomirus, which also moves theSelector
struct out of the original module to top of this package.
- Add benchmarking for the
parse
method by @lomirus, using an 87.0kB html file from wikipedia;
- Readme and other documentation improvements by @lomirus.
- Fails to parse if closing tag is seperated by new-line, like
<a></a\n>
. Closes #1.
- Add the
prelude
module. Now you can simply importEditable
,Htmlifiable
andQueryable
all just byuse html_editor::prelude::*;
; trim
method becomes(&mut self) -> &mut Self
from(self) -> Self
.- Replace the
try_into_element()
withinto_element()
, which simplifies the common use:try_into_element().unwrap()
- Add more examples.
- Now
parse()
returns aResult<Vec<Node>, String>
instead ofVec<Node>
for better error handling.
- In previous version,
parse
sometimes may return an unexpected result but without any error message. But now any currently known error will be delivered. - Tag string in
<script>
or<style>
cannot be parsed correctly. For example,<script>"<div></div>"</script>
would be parsed as a<div>
element in the<script>
instead of the plain string.
-
Omit the attribute if its value is empty. For example:
<!--Old--> <script src="index.js" type="module" defer=""></script> <!--New--> <script src="index.js" type="module" defer></script>
-
Use vector to store the attributes instead of hashmap, which can make its order stable. For example:
<!--Old. When an element turns to html, it may be--> <script src="index.js" type="module"></script> <!--But below is also a possible result--> <script type="module" src="index.js"></script> <!--New. The result would be unique, and just the same as its input--> <script src="index.js" type="module"></script>
- Fail to parse the attributes if the the last key of it doesn't have the value, like
<script src="index.js" type="module" defer></script>