Skip to content

Releases: lomirus/html_editor

v0.7.0

14 Nov 06:09
Compare
Choose a tag to compare
  • Add replace_with() method in Editable trait in #14 by @lomirus.
  • Improve autocomplete performance in try_parse() from O(n!) to O(n^2) in #16 by @lomirus.

v0.6.1

22 Apr 11:41
Compare
Choose a tag to compare

New Features

Refactor

  • Refactor Node::Element { name, attr, children } into Node::Element(Element) in #8 by @arduano.
  • Remove Node::into_element(self) in #8 by @arduano.
  • Implement From<&str> instead of ordinary trait method for Selector @lomirus.

Performance

  • Improve the performance (3~10 times faster) when parsing large html file by @lomirus.

v0.5.2

21 Aug 14:33
Compare
Choose a tag to compare

Fix

  • Failed to parse tags with whitespaces inside (exclude space), like <div\n></div> and <div\t></div>. Fixed by @lomirus. Closes #5.

v0.5.1

27 Apr 03:56
Compare
Choose a tag to compare

Fix

  • Fixed that the selector doesn't work for multiple class element by @lomirus in #4;

v0.5.0

15 Apr 15:47
Compare
Choose a tag to compare

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 to Node::Doctype to distinguish between html and xml by @lomirus.

Refactor

  • Remove prelude module, and replace it with operation module by @lomirus, which also moves the Selector 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

19 Mar 11:16
Compare
Choose a tag to compare

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 import Editable, Htmlifiable and Queryable all just by use html_editor::prelude::*;;
  • trim() method becomes (&mut self) -> &mut Self from (self) -> Self.
  • Replace the try_into_element() with into_element(), which simplifies the common use: try_into_element().unwrap()

Documentation

  • Add more examples.

v0.3.0

29 Jan 10:44
Compare
Choose a tag to compare

Refactor

  • Now parse() returns a Result<Vec<Node>, String> instead of Vec<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

19 Jan 12:49
Compare
Choose a tag to compare

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>

v0.1.0

19 Jan 12:48
Compare
Choose a tag to compare
v0.1.0