Preview and published page shows different result for special characters (<, >, &)
Categories
(developer.mozilla.org Graveyard :: KumaScript, defect)
Tracking
(Not tracked)
People
(Reporter: arai, Unassigned)
References
()
Details
discovered by bug 1334713. Unescaped special characters like <, >, & are not escaped in preview page, but escaped in published page. Steps to reproduce: 1. create a new page 2. choose "Source" in editor 3. enter the following {{jsxref("Operators/Comparison_Operators", "<", "#Less_than_operator")}} 4. preview 5. publish Actual result: preview page shows "<" published page shows "<" Expected result: both page shows same thing there are related bug in jsxref that it escapes $1 that's why published page shows "<" once both gets fixed, expected result is to showing "<"
Updated•7 years ago
|
Updated•7 years ago
|
Comment 1•5 years ago
|
||
Note to self, see if this is still an issue, and move this to mdn/kumascript
Comment 2•5 years ago
|
||
I've tested this page, which uses the jsxref
macro, and copied it to stage:
https://developer.allizom.org/en-US/docs/user:jwhitlock/bug1334887
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators#Relational_operators
In the rendered as well as the preview version, it shows "<", ">=", etc. The call uses the escaped HTML:
{{jsxref("Operators/Comparison_Operators", ">=", "#Greater_than_or_equal_operator")}}
I attempted to add unescaped symbols, like "<=", and had trouble doing it. I can add them in Source mode, and CKEditor then escapes them to "gt;" and "lt;".
I think there was an issue where jsxref double-escaped the HTML, which was fixed as part of bug 1335006:
https://github.com/mdn/kumascript/pull/108
https://github.com/mdn/kumascript/commit/9724b1c989d319019270ee9504df4631183382e0#diff-982cbf7ca044fee856084553f15c2ff2
I then believe the page was updated to send HTML-escaped strings to KumaScript, which now does the right thing.
Updated•4 years ago
|
Description
•