Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增强建议:parse 方法解析时可以自定义标签的括号为{}取代<> #15

Open
xjfnet opened this issue Mar 21, 2021 · 0 comments

Comments

@xjfnet
Copy link

xjfnet commented Mar 21, 2021

我在写一个 vscode 扩展,html5parser 提供了很大的帮助,首先表示感谢!

我写的 vscode 扩展的作用是为 SSCMS 系统的 html 模板提供自动完成提示功能,它的模板标签是下面这样的

<stl:content type="Title"></stl:content>

模板标签也可以用在其它标签的属性值中,但要把 <> 换成 {},像下面这样

<a href="#" title="{stl:content type="Title"}"></a>

也可以用在其它标签的内容中,像下面这样

<a href="#">{stl:content type="Title"}</a>

所以,先用<>作为定界符解析一次,得到属性值或标签的内容后再用{}作为定界符再解析一次,就可以很完美了。

@xjfnet xjfnet changed the title 增强建议:parse 方法解析时可以自定义标签的括号为{}而不是<> 增强建议:parse 方法解析时可以自定义标签的括号为{}取代<> Mar 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant