Releases: AmeroHan/ACandy
Releases · AmeroHan/ACandy
v0.6.0
BREAKING CHANGE | 破坏性变更
For non-predefined HTML elements, a.xxx
will also convert the tag name xxx
to lowercase. For example:
对于非预定义的 HTML 元素,a.xxx
也会将标签名 xxx
转为小写。例如:
tostring(a.NoSuchElement) --> <nosuchelement></nosuchelement>
Features | 特性
- Add
acandy.ACandy
to create a configuredACandy
instance.
新增acandy.ACandy
来创建一个配置后的ACandy
实例。 - User-side type annotations, based on LuaCATS (a comment-based type system used by LuaLS/lua-language-server).
用户侧类型标注,基于 LuaCATS(LuaLS/lua-language-server 所用的注释类型系统)。
Full Changelog: v0.5.0...v0.6.0
v0.5.0
中文
破坏性变更
- 元表的
__acandy_fragment_like
和__acandy_props_like
被更名为__acandy_list_like
和__acandy_table_like
。
特性
- 增加了
acandy.Comment
,用于写 HTML 注释。 - 标签名(规范于 #syntax-tag-name 和 #prod-potentialcustomelementname)以及属性名(规范于 #syntax-attribute-name)的验证器现在遵循 HTML 标准。#9
- 当序列化属性值和文本节点时,其中的 U+00A0 NO-BREAK SPACE(UTF-8 格式)现在会被替换为
,遵循 HTML 标准#serialising-html-fragments。#9 - 现在,任何值是类列表的的节点都可以像 fragment 一样被序列化。
- 在创建元素时,现在可以接受任何类列表的参数,其子元素将成为新元素的子元素。此外,如果该值还是类表的,则其字符串键及对应值将成为元素属性的名称和值。
修复
- 修复了当
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
containsnil
, only values before thenil
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
v0.4.0
BREAKING CHANGES
-
Elements are now accessed from
<module>.a
instead of directly from the module, for instance:before 0.4:
local a = require('acandy') local frag = a.Fragment { a.h1 'An Example', a.p 'Hello, world!', }
in 0.4:
local acandy = require('acandy') local a = acandy.a local frag = acandy.Fragment { a.h1 'An Example', a.p 'Hello, world!', }
-
image
andmenuitem
are no longer considered predefined HTML elements, which meansa.image
anda.menuitem
are no longer case-insensitive.
Features
acandy.Doctype.HTML
supported. It returns'<!DOCTYPE html>'
ontostring
.a.fencedframe
is now case-insensitive.
v0.3.0-beta
Features
- Full English documentation.
英文文档。
Fixes
- Incorrect code snippet for
a.some
in documentation.
文档a.some
示例代码错误。
v0.3.0-alpha
v0.2.0-alpha
- 修正了 #1 错误的实体转换。
- 新增了
acandy.Raw
,并完善了相应的文档。
v0.1.0-alpha
实现了目前想到的所有语法,并完善了文档。差不多可以用了。