Normalize text nodes after wbr tags are removed from [math]/[eqn] posts.

This commit is contained in:
ccd0 2016-03-13 15:28:21 -07:00
parent 66da272698
commit 9182098de5

View File

@ -64,7 +64,9 @@ Fourchan =
math: ->
return unless /\[(math|eqn)\]/.test @nodes.comment.textContent
# XXX <wbr> 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