Skip to content

v0.5.0

Compare
Choose a tag to compare
@AmeroHan AmeroHan released this 20 Nov 03:51
· 5 commits to main since this release
中文

破坏性变更

  • 元表的 __acandy_fragment_like__acandy_props_like 被更名为 __acandy_list_like__acandy_table_like

特性

修复

  • 修复了当 acandy.some.tag 的参数列表包含 nil 时,仅 nil 之前的值会被考虑的问题。
  • 修复了当序列化定义了 __tostring 的表时,其返回值未被转义的问题。#11

其他变更

  • 文档被分为英文和中文版本,不同语言的内容不再挤在一起。
  • 添加了更多测试用例。

完整日志: v0.4.0...v0.5.0

BERAKING CHANGES

  • Metatables’ __acandy_fragment_like and __acandy_props_like was renamed to __acandy_list_like and __acandy_table_like.

Features

  • Add acandy.Comment to write HTML comments.
  • Tag name (specified at #syntax-tag-name and #prod-potentialcustomelementname) and attribute name (specified at #syntax-attribute-name) validators now follow HTML Standard. #9
  • When serializing attribute values and text nodes, U+00A0 NO-BREAK SPACE (in UTF-8 format) inside would be replaced with   now, as specified in HTML Standard#serialising-html-fragments. #9
  • Now any node whose value is list-like can be serialized as if it were a fragment.
  • When creating elements, any argument that is list-like is accepted now, whose children would become the element’s children. Upon this, if the value is also table-like, its string keys and correspond values would become the names and values of the element’s attributes.

Fixes

  • Fixed that when the argument list of acandy.some.tag contains nil, only values before the nil would be considered.
  • Fixed that when serializing a table value with __tostring, its return value was not escaped. #11

Other Changes

  • The documentation was separated to English and Chinese versions. Lines in different languages no longer crowded together.
  • Added more test cases.

Full Changelog: v0.4.0...v0.5.0