52pojie的贴子源码保存为Markdown时错误
srdr0p opened this issue · 1 comments
srdr0p commented
现象:保存为Markdown时,源码中换行丢失。
HTML源码类似于:
<pre><em class="CopyMyCode" style="cursor: pointer; font-size: 12px; color: rgb(51, 102, 153) !important;"> 复制代码</em><em class="hideCode" style="cursor: pointer; font-size: 12px; color: rgb(51, 102, 153) !important;"> 隐藏代码<br></em><code class="javascript hljs language-javascript"><span class="hljs-comment">//通过正则替换类型字符串中Webcast或者OpenWebcast为空,保留剩下部分</span>
eu.<span class="hljs-property">nl</span>=<span class="hljs-string">"/(^|\.)Webcast(Open)?/"</span>
<span class="hljs-keyword">let</span> en = ei.<span class="hljs-title function_">replace</span>(eu.<span class="hljs-property">nl</span>, <span class="hljs-string">""</span>)
<span class="hljs-comment">//取类型字符串关联的一些字符成数组eo</span>
<span class="hljs-keyword">let</span> eo = [et.<span class="hljs-property">relation</span>[ei], et.<span class="hljs-property">relation</span>[en], en, ei].<span class="hljs-title function_">filter</span>(<span class="hljs-function"><span class="hljs-params">et</span>=></span>et)
<span class="hljs-comment">//这里et.typeHintPrefix固定为["webcast.im"],然后和前面的eo拼接一些可能的对象调用关系</span>
, eA = eo.<span class="hljs-title function_">map</span>(<span class="hljs-function"><span class="hljs-params">ei</span>=></span>et.<span class="hljs-property">typeHintPrefix</span>.<span class="hljs-title function_">map</span>(<span class="hljs-function"><span class="hljs-params">et</span>=></span><span class="hljs-string">`<span class="hljs-subst">${et}</span>.<span class="hljs-subst">${ei}</span>`</span>)).<span class="hljs-title function_">reduce</span>(<span class="hljs-function">(<span class="hljs-params">et,ei</span>)=></span>et.<span class="hljs-title function_">concat</span>(ei)).<span class="hljs-title function_">concat</span>(eo);
<span class="hljs-comment">//eA=["webcast.im.PushFrame","webcast.im.PushFrame","PushFrame","PushFrame"]</span>
</code></pre>
代码被<pre>
包含,因此HTML源码中的换行符是有意义的,应当保留。
mika-cn commented
谢谢回馈,确实有这个问题,移除代码块里的按钮逻辑有问题,已在 0.4.43 版中修复,请更新扩展。