Skip to content

Move SyntaxHighlightFilter to end of pipelines (redux)

Brett Walker requested to merge bw-syntaxhighlighter-redux into master

What does this MR do and why?

Fix an issue that was found in production with the deployment of the original MR, Move SyntaxHighlightFilter to end of pipelines (!99048 - merged)

Basically under certain circumstances, when the main pre node is replaced, if there is another embedded pre node, it would end up being orphaned. The doc.xpath(XPATH).each do |node| loop still knows about it and tries to process it, and ends up with a Cannot replace a node with no parent error.

This actually happened with the original codeine that the orphaned node was still processed (run through Rouge). Now we can detect it and avoid the extra processing altogether.

The main code changes have already been reviewed in !99048 (merged). Take a look at the last commit to see what has been changed by this MR.

How to set up and validate locally

Use the following markdown, taken from the data that actually caused the error:

<table>
    <tr>
        <td><pre><code>class Child;
class Parent {
    public:
    Parent(Child& child) : mChild(child) {}

    private:
    Child& mChild;
};</code></pre></td>
    </tr>
</table>

Put that in a comment field and take a look at the Preview. The preview should work.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Brett Walker

Merge request reports