We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
<pre><code></pre></code>
之间的代码不能在小程序中正常显示
The text was updated successfully, but these errors were encountered:
我有一个解决办法,就是将<pre>标签去掉,只留下<code>,并且将<code>标签中的\r\n换为<p>\n</p>,这样解决了<code>标签中多行代码显示为一行的问题。具体方法是改写小程序中 detail.js 中获取文章内容并交给 wxParse 处理的函数:
<pre>
<code>
\r\n
<p>\n</p>
detail.js
wxParse
WxParse.wxParse('article', 'html', response.data.content.rendered.replace(/<pre>/g, "").replace(/<\/pre>/g, "").replace(/\r\n(?!<\/code>)/g,"<p>\n<\/p>"), self, 5);
效果预览:
我也是刚刚解决这个问题,随后我会写篇博文来具体说明。
Sorry, something went wrong.
这个思路不错
哇,感谢作者的认同,今天把这个问题的解决方法总结成一篇博文,地址:解决 WordPress 微信小程序文章内代码显示、图片非 CDN 地址、图片附带链接的问题 同时还解决了其他一些问题,希望能帮到需要的人。
No branches or pull requests
<pre><code></pre></code>
之间的代码不能在小程序中正常显示
The text was updated successfully, but these errors were encountered: