gpt4 book ai didi

thymeleaf - Thymeleaf 中的 Markdown

转载 作者:行者123 更新时间:2023-12-02 23:35:34 26 4
gpt4 key购买 nike

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

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

如果我可以在 HTML 中嵌入 markdown,那将会很有用。

最佳答案

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

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

关于thymeleaf - Thymeleaf 中的 Markdown,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34115270/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com