Releases: lomirus/html_editor
Releases · lomirus/html_editor
v0.7.0
v0.6.1
New Features
- 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
- 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.
Performance
- Improve the performance (3~10 times faster) when parsing large html file by @lomirus.
v0.5.2
v0.5.1
v0.5.0
Features
- 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.
Refactor
- 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.
Chore
- Add benchmarking for the
parse
method by @lomirus, using an 87.0kB html file from wikipedia;
Documentation
- Readme and other documentation improvements by @lomirus.
v0.4.0
v0.4.0 (2022-03-19)
Fix
- Fails to parse if closing tag is seperated by new-line, like
<a></a\n>
. Closes #1.
Refactor
- 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()
Documentation
- Add more examples.
v0.3.0
Refactor
- Now
parse()
returns aResult<Vec<Node>, String>
instead ofVec<Node>
for better error handling.
Fix
- In previous version,
parse
sometimes may return an unexpected result but without any error message. And 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.
v0.2.0
Fix
- 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>
Enhancements
-
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. Maybe--> <script src="index.js" type="module"></script> <!--But it 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>