Bug 1033422 - Bug: Code snippets missing
Summary: Bug: Code snippets missing
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: PressGang CCMS
Classification: Community
Component: DocBook-builder
Version: 1.2
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Lee Newson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-22 04:34 UTC by Misha H. Ali
Modified: 2013-11-24 22:50 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-11-24 22:50:06 UTC


Attachments (Terms of Use)
Example of missing code (64.67 KB, image/png)
2013-11-22 04:34 UTC, Misha H. Ali
no flags Details

Description Misha H. Ali 2013-11-22 04:34:21 UTC
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.

Comment 1 Misha H. Ali 2013-11-22 04:35:24 UTC
Set severity to high to request urgent action on this if possible.

Comment 2 Lee Newson 2013-11-22 05:05:54 UTC
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.

Comment 3 Lee Newson 2013-11-22 05:23:11 UTC
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.

Comment 4 Matthew Casperson 2013-11-24 22:45:21 UTC
<pre> and <a> elements are no longer modified by the style guide overlay code.

Comment 6 Lee Newson 2013-11-24 22:50:06 UTC
Marking as closed since Misha verified on IRC that it was working and with the extra fix Matt did it should fix all instances.


Note You need to log in before you can comment on or make changes to this bug.