You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 19, 2022. It is now read-only.
var text = "|\r4f346db62b94a3d24e27c235be4c69420\r|";
text = text.replace('|\r4f346db62b94a3d24e27c235be4c69420\r|', "<code>$'</code>");
console.log(JSON.stringify(text));
text = text.replace('|\r4f346db62b94a3d24e27c235be4c69420\r|', "<code>$'</code>");
console.log(JSON.stringify(text));
/*结果如下:
"<code>|\r4f346db62b94a3d24e27c235be4c69420\r|#039;</code>"
"<code><code>|\r4f346db62b94a3d24e27c235be4c69420\r|#039;</code>#039;</code>"
*/
然后就永远替换不完了.
再然后 releaseHolder 方法中有一个 deep 的变量,用于防止这种死循环, 所以会看到出现 10 次同样的内容.
重现的POC(复制下面的内容至sf的 markdown 编辑器区域内):
$'
为什么会发现这个问题呢, 要从今天回答的一个问题说起:

帖子地址为: http://segmentfault.com/q/1010000004217885
在编辑器里输入
mysql
语句的时候, 里面有正则表达式, 然后就看到右边的预览区域出现了很神奇的东东.最后经过精简, 得到了上面那样的内容.
The text was updated successfully, but these errors were encountered: