API接口获取的数据为什么有<p>标签?
bDnlXL9e • 2023-06-10 20:57 • 529 次点击 • ❓问题求助
官方文档是这样的
真实情况是这样的,"description" 里面的 P 标签可以删除吗?
这个是markdown编辑器自带的吗?在哪里可以关掉?
评论:
独元殇 管理员2023-06-11 17:34
其实,这里有个折中的办法。
emlog pro 使用的 markdown2html 库是 parsedown.php , 但有时我们有些内容不想让这个库解析,目前来看,有一种方式。
https://parsedown.org/tests/sparse_html ,这个文档好像是说,内容里被 html 标签包围的东西,它不会动的。
就像 https://emlog.cn/content/uploadfile/202306/78ae1686475804.png 我截得这个图里的。
this is a **test**.
<p>this is a **test**.</p>
后者里面的 ** ** 就不会被 markdown 解析器解析。原封不动输出来。
所以,你可以试试主动在 markdown 源码前后写上 <p> 和 </p> 标签(这样不管之间怎么写,都不会被 parsedown.php 搭理),之后在处理 json 数据时,直接删掉前面的 3 个字符和后面的 4 个字符如何?
emlog pro 使用的 markdown2html 库是 parsedown.php , 但有时我们有些内容不想让这个库解析,目前来看,有一种方式。
https://parsedown.org/tests/sparse_html ,这个文档好像是说,内容里被 html 标签包围的东西,它不会动的。
就像 https://emlog.cn/content/uploadfile/202306/78ae1686475804.png 我截得这个图里的。
this is a **test**.
<p>this is a **test**.</p>
后者里面的 ** ** 就不会被 markdown 解析器解析。原封不动输出来。
所以,你可以试试主动在 markdown 源码前后写上 <p> 和 </p> 标签(这样不管之间怎么写,都不会被 parsedown.php 搭理),之后在处理 json 数据时,直接删掉前面的 3 个字符和后面的 4 个字符如何?
独元殇 管理员2023-06-11 17:36
@独元殇:[img]https://emlog.cn/content/uploadfile/202306/thum-78ae1686475804.png[/img]