Thymeleaf的Markdown

什么是在Thymeleaf实施Markdown的最佳方式?

>模板模式
>一种新的方言(什么处理器?)

如果我可以在HTML中嵌入markdown会很有用.

最佳答案 根据我从
Javadoc的理解,我将首先实现markdown启动器作为AbstractAttributeModelProcessor并使用structureHandler.setLocalVariable来设置该变量.然后我必须将markdown执行程序实现为AbstractTextProcessor,并在doProcess方法中使用context.getVariable来测试变量,如果设置为使用新文本替换文本:text.setText(transformMarkdown(..)).

https://github.com/thymeleaf/thymeleaf/issues/439查看更多信息.

点赞