Merged requested to merge stanhu/gitlab-ce:fix-inline-filter-speed into master
node.replace was being unnecessarily called for every text node in
the document due to a comparison bug. The code previously was comparing the
HTML representation of the full document against the text node, which would
always fail. Fix the comparison to just compare the modified text.
Closes #18011 (moved)