Closed Bug 1171413 Opened 9 years ago Closed 9 years ago

Content disappears while editing or translating articles with <code> tags. Example: l10n editor only shows 89 lines in https://support.mozilla.org/en-US/kb/upgrade-graphics-drivers-use-hardware-acceleration/edit

Categories

(support.mozilla.org :: Knowledge Base Software, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: pollti, Assigned: osmose)

References

()

Details

(Whiteboard: p=3 r=?)

Attachments

(3 files)

Attached image animated_screenshot
STR: #Visit https://support.mozilla.org/de/kb/wie-aktualisiere-ich-meine-grafiktreiber/edit (Fx or IE) #Scroll down the l10n part (right editor). Actual result: -The editor only shows lines 1-89 and turns into white then.
I can reproduce for other locales, too. Must be something related to migrating to ACE? Also, when you click "Toggle syntax highlighting", all looks good in that mode. I'll post about it in the forums, together with the 'temporary workaround' I mentioned above.
Thank you very much, vesper :)
Summary: l10n editor only shows 89 lines in https://support.mozilla.org/de/kb/wie-aktualisiere-ich-meine-grafiktreiber/edit → l10n editor only shows 89 lines in https://support.mozilla.org/en-US/kb/upgrade-graphics-drivers-use-hardware-acceleration/edit
To clarify, we didn't migrate to ACE, we migrated *away* from ACE, to CodeMirror. This gives us a lot better support for non-latin scripts and RTL languages. Also, this is definitely related. These are the errors we are getting. One of these two errors seems to happen on every scroll event after the text disappears: TypeError: pend is undefined wiki.editor-min.37582d11f490.js:7:31888 TypeError: pend.text is undefined wiki.editor-min.37582d11f490.js:7:31888 Seems like it will be pretty easy to track down in an unminified build.
Whiteboard: p=?
+1 to Mike's clarification. -1 to my absentmindedness when trying to sound smart. Thanks for spotting what's what so fast. Looking forward to the fix!
It looks like the issue is triggered by something in the "= After upgrading your graphics driver =" section - I'm wondering if the two code sections in there could be responsible - this is one of them: <code>Components.classes["@mozilla.org/extensions/blocklist;1"].getService(Components.interfaces.nsITimerCallback).notify(null);</code> Could the formatting here break the text editor? The code tag is in place, but maybe it's not enough for CodeMirror?
I'm not sure how to estimate this, since I haven't worked with CodeMirror yet. Rehan, can you estimate this?
Flags: needinfo?(rdalal)
I'm going to say (as of now) this is a 3pt'er because the initial issue is no longer an issue. I would need to try and reproduce what was happening before I'd be able to fix it. In the meanwhile, if this issue pops up anywhere else we should make sure to copy the content to the bug so that we can continue to reproduce the issue. This is likely related to the syntax highlighting plugin.
Flags: needinfo?(rdalal)
Related discussion thread: https://support.mozilla.org/en-US/forums/contributors/711329 [Bug 1171413] Content missing while translating or editing certain articles (was: Suddenly, content disappears while translating)
Attached file article.txt
This is the current content of that article, for future reference.
Here is one more localised article where this bug seems to happen: https://support.mozilla.org/fi/kb/useampien-profiilien-kaytto-thunderbirdissa/edit the article is currently untouched. Last accepted revision is made by me and then there were no problems.
It seems that CodeMirror doesn't know how to highlight <code> tags in articles and stops working because of that. I think that clarifying <code> to the highlighter would fix the problem - all affected articles contain <code> tags and the content is shown when you remove them. (Please ignore my babbling if I don't understand the situation correctly.)
Several new Thimble articles seem to be affected as well (e.g. https://support.mozilla.org/en-US/kb/how-do-i-add-code-comments-thimble-project/edit).
Marking as 3pts because of comment 7.
Whiteboard: p=? → p=3
Michal, would you mind ranking this on your backlog? Rehan, Mike, does comment #15 change the estimate?
Whiteboard: p=3 → p=3 r=?
Flags: needinfo?(mdziewonski)
I don't know enough about this to change the estimate. I think it should stay at 3 points.
Ranked, thanks for the ping.
Flags: needinfo?(mdziewonski)
Summary: l10n editor only shows 89 lines in https://support.mozilla.org/en-US/kb/upgrade-graphics-drivers-use-hardware-acceleration/edit → Content disappears while editing or translating articles with <code> tags. Example: l10n editor only shows 89 lines in https://support.mozilla.org/en-US/kb/upgrade-graphics-drivers-use-hardware-acceleration/edit
This seems to affect <code> tags as well as <pre> and <nowiki> tags, as they all use the same pattern in the CodeMirror config. The current config seems to be attempting to color everything after a <code>/<pre>/<nowiki> that's missing an ending tag as a comment, and all the fixes to the disappearing content that I have come up with only either don't color anything unless the closing tag exists, or color only to the end of the line that the opening tag occurs on. I'm going to try and find a fix that highlights to the end of the file if necessary, but if I can't find anything I'll just put up a fix that highlights once a closing and opening tag both exist.
Assignee: nobody → mkelly
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Rehan, thank you. It's working for me. FYI, I filed a dupe bug 1234664 and it works for me for both the articles I tagged.
Rehan, like I said, it is working as in I can view the content. But now "Submit" button is not working for me.
The submit problem is probably bug 1234789, and seems to be fixed now.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: