Skip to content

Releases: AmeroHan/ACandy

v0.6.0

22 Nov 19:42
Compare
Choose a tag to compare

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 configured ACandy instance.
    新增 acandy.ACandy 来创建一个配置后的 ACandy 实例。
  • User-side type annotations, based on LuaCATS (a comment-based type system used by LuaLS/lua-language-server).
    用户侧类型标注,基于 LuaCATSLuaLS/lua-language-server 所用的注释类型系统)。

Full Changelog: v0.5.0...v0.6.0

v0.5.0

20 Nov 03:51
Compare
Choose a tag to compare
中文

破坏性变更

  • 元表的 __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 &nbsp; 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

v0.4.0

13 Nov 11:07
Compare
Choose a tag to compare

BREAKING CHANGES

  1. 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!',
    }
  2. image and menuitem are no longer considered predefined HTML elements, which means a.image and a.menuitem are no longer case-insensitive.

Features

  1. acandy.Doctype.HTML supported. It returns '<!DOCTYPE html>' on tostring.
  2. a.fencedframe is now case-insensitive.

v0.3.0-beta

18 Oct 08:23
Compare
Choose a tag to compare
v0.3.0-beta Pre-release
Pre-release

Features

  • Full English documentation.
    英文文档。

Fixes

  • Incorrect code snippet for a.some in documentation.
    文档 a.some 示例代码错误。

v0.3.0-alpha

03 Apr 12:42
Compare
Choose a tag to compare
v0.3.0-alpha Pre-release
Pre-release

破坏性变更

  • 移除tag_name的别名tagnamea5a3c67 );
  • 移除acandy.from_yieldsb403a4b );
  • 为元素子结点赋nil后,后续结点不再自动补位( 5719872 );

新特性

  • 元素可以获取childrenattributes属性,详见文档。

其他

  • 优化 提高模块的稳定性
    优化 模块的流畅度();
  • 扩充了文档;
  • 增加了一些测试。

v0.2.0-alpha

26 Jan 20:10
Compare
Choose a tag to compare
v0.2.0-alpha Pre-release
Pre-release

v0.1.0-alpha

02 Jan 18:21
Compare
Choose a tag to compare
v0.1.0-alpha Pre-release
Pre-release

实现了目前想到的所有语法,并完善了文档。差不多可以用了。