From 9182098de5ba09912de6ae8a897041ad2a718fdd Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 13 Mar 2016 15:28:21 -0700 Subject: [PATCH] Normalize text nodes after wbr tags are removed from [math]/[eqn] posts. --- src/Miscellaneous/Fourchan.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Miscellaneous/Fourchan.coffee b/src/Miscellaneous/Fourchan.coffee index 1e67741e5..a68996442 100644 --- a/src/Miscellaneous/Fourchan.coffee +++ b/src/Miscellaneous/Fourchan.coffee @@ -64,7 +64,9 @@ Fourchan = math: -> return unless /\[(math|eqn)\]/.test @nodes.comment.textContent # XXX tags frequently break MathJax; remove them. - $.rm wbr for wbr in $$ 'wbr', @nodes.comment + if (wbrs = $$ 'wbr', @nodes.comment).length + $.rm wbr for wbr in wbrs + @nodes.comment.normalize() cb = => return unless doc.contains @nodes.comment $.off d, 'PostsInserted', cb