refactor(markdown): unify yaml tag block syntax on role=tag
Drop legacy yaml/tag info string; tag blocks now require ```yaml role=tag. Add fence-line tag=/id= attributes that override YAML body values, and move parseBlockAttrs to src/markdown/block-attrs.ts so scanner and render extensions share one parser.
This commit is contained in:
+4
-4
@@ -489,7 +489,7 @@ track npc#john.dwarf.warrior[hp=4/4 ac=15 name="John"]
|
||||
|
||||
## YAML 标签
|
||||
|
||||
使用 ```yaml role=tag 代码块创建自定义标签(推荐,`yaml` 语言可被语法高亮):
|
||||
使用 ```yaml role=tag 代码块创建自定义标签(`yaml` 语言可被语法高亮):
|
||||
|
||||
````markdown
|
||||
```yaml role=tag
|
||||
@@ -500,11 +500,11 @@ body: 标签内容
|
||||
```
|
||||
````
|
||||
|
||||
也支持旧写法 ```yaml/tag(等价,但无语法高亮):
|
||||
`tag`、`id` 等简单属性也可以直接写在 fence 行上(fence 行属性优先于 YAML 内容):
|
||||
|
||||
````markdown
|
||||
```yaml/tag
|
||||
tag: tag-name
|
||||
```yaml role=tag tag=tag-name id=my-id
|
||||
class: custom-class
|
||||
body: 标签内容
|
||||
```
|
||||
````
|
||||
|
||||
Reference in New Issue
Block a user