Skip to content

Releases: sparsetech/pine

v0.1.7

04 Oct 13:10
64fc19f
Compare
Choose a tag to compare

Version 0.1.7 fixes a number of bugs and improves the parsing performance. A benchmark suite was added and is now triggered as part of every CI build. This release also adds support for Scala.js 1.2.0 and Scala Native 0.4.0-M2.

Migration

Previously, the DOM parser was used in Scala.js which had slightly different semantics depending on the browser. From this release onwards, the internal HTML parser is the default on all platforms.

If you were calling the internal HTML parser, the following changes are necessary:

  • pine.internal.HtmlParser.fromString(str, xml = false)pine.HtmlParser.fromString(str)
  • pine.internal.HtmlParser.fromString(str, xml = true)pine.XmlParser.fromString(str)

Bug fixes

  • HtmlParser: Prevent infinite loop when tag is not closed (#61)
  • HtmlParser: Parse DOCTYPE case-insensitively (#62)
  • Travis CI: Use OpenJDK to fix CI build (#63)
  • Fix Node.removeAll() (#66, by @mosteli)
  • Allow spaces before and after equal sign in attribute definition (#70, by @lavrov)
  • Attributes: Fix type of start attribute on <ol> (#73)

Improvements

  • Improve performance of HTML parser on JVM (#67)
  • Build: Update Seed to fix CI failures (#71)
  • Build: Update dependencies (#72)
  • Node: Add textContent function (#74)
  • Add benchmark suite (#75)
  • Drop DOM parser (#76)

v0.1.6

18 Jul 11:08
Compare
Choose a tag to compare

This release fixes two publishing-related bugs introduced in v0.1.5.

Bug fixes

  • Fix Scala Native build and run test cases (#58, #59)
  • Fix Scala 2.13's JVM artefact (#60)

v0.1.5

07 Jul 09:34
Compare
Choose a tag to compare

This release adds support for Scala 2.13.

Changes

  • Support Scala 2.13 (#55)
  • Drone CI: Enable Scala 2.13 build (#56)
  • Build: Fix publishing (#57)

Contributors

@kevinwright, @eed3si9n

v0.1.4

28 Mar 12:41
Compare
Choose a tag to compare

Changes

  • Add support for rendering SVG nodes (#48)
  • Add Seed build files (#51)
  • Take list of attributes in Node.suffixIds (#54)

v0.1.3

16 Jun 13:46
Compare
Choose a tag to compare

Migration

The html macro now takes a path relative to the source file. This improves support for other build environments such as IntelliJ or Bloop (see #40).

A regression in token list attributes that could cause duplicate items was fixed (see #46).

v0.1.2

20 Mar 18:10
Compare
Choose a tag to compare

Migration

Migration should be fairly smooth. Only a few breaking changes were made.

The attribute syntax was simplified

The old syntax for defining attributes was a bit clunky:

implicit class TagAttributesCustomType(tag: Tag[pine.tag.Div]) {
  def myValue: Option[String] = tag.attr("my-value").map(_.toString)
  def myValue(value: String): Tag[CustomType] = tag.setAttr("my-value", value)
}

myDiv.myValue  // Returns Option[String]

This code now becomes:

implicit class TagAttributesCustomType(tag: Tag[pine.tag.Div]) {
  val myValue = TagAttribute[CustomType, String](tag, "my-value")
}

myDiv.myValue()  // Returns String

The syntax for TagRef attributes was changed as well. See the manual for more details on defining attributes on Tag and TagRef.

Token list attributes have better support

// The HTML attribute "class" used to be stringly typed:
tag.Div.`class`("a")

// Now, it is equipped with functions for more convenient manipulation:
tag.Div.`class`.add("a")

This allows us to extend the functionality previously offered by css to all other token list attributes:

// Deprecated:
tagRef.css(state, "css")

// Use instead:
tagRef.`class`.state(state, "css")

See this section in the manual for more details.

Improvements

  • TagRef: Introduced opt to allow for optional references (#43).

Depending on the TagRef, dom now returns the concrete type:

TagRef.ByTag[tag.A].dom: dom.html.Anchor
TagRef.ByTag[tag.A].opt.dom: Option[dom.html.Anchor]
TagRef.ByTag[tag.A].each.dom: List[dom.html.Anchor]  // Before: domAll
  • Boolean attributes can be defined for custom types (#36)
  • TagRef: Add insertAt() (dfba494)
  • TagRef: Add insertBefore() and insertAfter() (3833652)
  • TagRef: Add clearAll() (c376427)
  • TagRef: Add missing event handlers for cut, paste and copy (650e3cb, ea37bdb)
  • TagRef: Remove redundant event handlers from HTML tags (81cc3ef)
  • Node: Add tag() to change the tag name (f79420f)
  • Node: Add byTagAll() and byClassAll() (7adb356)
  • XmlParser: Handle CDATA tags (c402b4a)

Bug fixes

  • Fix attributes of Boolean types such as readonly (#44)
  • Support string concatenation in HTML/XML interpolator (#41)
  • Fix all file descriptors when loading HTML files (5563657, b5d0a63)
  • Do not report errors to the browser console when parsing valid HTML/XML documents (1ca1173)

Contributors

Thanks to @erikvanoosten for extensive testing and ideas.

v0.1.1

30 Dec 22:47
Compare
Choose a tag to compare

Improvements

Bug fixes

  • TagRef: Could not access class on ByClass (d37d0fc)
  • HtmlParser: Fix parsing of comments (1870d8c, 861bf16)
  • InlineHtml: Do not create empty text boxes (735f149)