fkzoo 發表於 2019-8-27 20:47:55

自定义代码spoiler的问题

<font color="#444444"><font face="Tahoma,">用在单纯文字上功能是正常的</font></font><br /><font color="#444444"><font face="Tahoma,">但是只要里面一加其他代码就失效了,如加粗、改字体等等</font></font>怎么适配spoiler里包含Discuz代码?<br /><br />代码<em>, </em>444444<em>, </em>Tahoma<em>, </em>spoiler

VioletTec 發表於 2019-12-20 21:34:43

<font face="微软雅黑"><font size="4">由于DISCUZ本身部分代码有误,导致自定义discuz代码中只要包含方括号,则代码无效.</font></font><font face="微软雅黑"><font size="4">因此还需要修改这个文件:<strong><font color="#ff0000">source/function/cache/cache_bbcodes.php</font></strong></font></font><br /><font face="微软雅黑"><font size="4">中的这个代码</font></font><br /><ol><li>&lt;font size=&quot;3&quot;&gt;$regexp = array&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;(<br /><li>1 =&gt; &quot;/\[{bbtag}]([^&quot;\[]+?)\[\/{bbtag}\]/is&quot;,<br /><li>2 =&gt; &quot;/\[{bbtag}=(['&quot;]?)([^&quot;\[]+?)(['&quot;]?)\]([^&quot;\[]+?)\[\/{bbtag}\]/is&quot;,<br /><li>3 =&gt; &quot;/\[{bbtag}=(['&quot;]?)([^&quot;\[]+?)(['&quot;]?),(['&quot;]?)([^&quot;\[]+?)(['&quot;]?)\]([^&quot;\[]+?)\[\/{bbtag}\]/is&quot;<br /><li>);&lt;/font&gt;</ol><font size="4"><br /></font><br /><font face="微软雅黑"><font size="4"><font color="#ff0000"><strong>更改为:</strong></font></font></font><br /><font size="4"><br /></font><br /><ol><li>&lt;font size=&quot;3&quot;&gt;$regexp = array&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;(<br /><li>1 =&gt; &quot;/\[{bbtag}](.+?)\[\/{bbtag}\]/is&quot;,<br /><li>2 =&gt; &quot;/\[{bbtag}=(['&quot;]?)(.+?)(['&quot;]?)\](.+?)\[\/{bbtag}\]/is&quot;,<br /><li>3 =&gt; &quot;/\[{bbtag}=(['&quot;]?)(.+?)(['&quot;]?),(['&quot;]?)(.+?)(['&quot;]?)\](.+?)\[\/{bbtag}\]/is&quot;<br /><li>);&lt;/font&gt;</ol><br /><br /><br /><font size="3"><font color="#ff0000"><strong>更改之后在后台刷新所有缓存即可!!!!</strong></font></font><br /><br /><strong><font size="3"><br /></font></strong><br /><strong><font size="3">转自Discuz原官方论坛贴:https://www.discuz.net/thread-1949371-1-1.html</font></strong><br />
頁: [1]
查看完整版本: 自定义代码spoiler的问题