Hide Forgot
Created attachment 827565 [details] Example of missing code Description of problem: Some code snippets in a guide I'm working on are just disappearing for no reason. If I use a direct link to a topic, the code appears properly but otherwise there are missing bits (see screenshot). Lee Newson thinks it may be because of the spellchecked hence I've logged it for that component.
Set severity to high to request urgent action on this if possible.
I tracked this down to the new custom dictionary popups/highlighting. The problem is caused by the jQuery replaceWith() method on line 2974 of overlay.js. Since the span text is "<namedCache" this is then parsed in the replaceWith() method, however since it isn't valid HTML it just gets replaced by a empty string.
I've done a partial fix on this, however there is still a low chance that this could still happen for custom dictionary entries that have the following characters: < > " ' & Since the git repo hasn't been pushed by the looks of it, here is the change I made to line 2974: // If the content has changed, ie a dictionary match was found, then update the span if (textNode.textContent !== fixedText) { jQuery(textNode).replaceWith(fixedText); } The change should also have a small performance improvement as it's not having to recreate and then replace every span in the book.
<pre> and <a> elements are no longer modified by the style guide overlay code.
Marking as closed since Misha verified on IRC that it was working and with the extra fix Matt did it should fix all instances.