Closed Bug 1284781 Opened 9 years ago Closed 9 years ago

Samples opened in JSFiddle will fail if CSS includes HTML escapes like  

Categories

(developer.mozilla.org Graveyard :: General, defect)

All
Other
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: chenpighead, Unassigned)

References

Details

(Keywords: in-triage, Whiteboard: [specification][type:bug])

What did you do? ================ 1. visit https://developer.mozilla.org/en-US/docs/Web/CSS/clear 2. click [OPEN IN JSFIDDLE]/[OPEN IN CODEPEN] button below https://developer.mozilla.org/en-US/docs/Web/CSS/clear#CSS_Content What happened? ============== CSS style in jsfiddle/codepen does not work What should have happened? ========================== CSS style in jsfiddle/codepen should take effect Is there anything else we should know? ====================================== If you manually copy texts in css content from MDN and copy it to jsfiddle/codepen, it works. Not sure if this is something about text encoding problem. This may mislead users to think the examples on MDN are wrong/not working.
Try copy css content from jsfiddle's css textarea after clicking [OPEN IN JSFIDDLE] and paste it to a text file. Open that text file w/ editors like vim, few strange characters appear in each line of style settings.
The CSS contained   characters, which get removed when you click the "Tidy" button in JSFiddle. I removed them, and after waiting for the caches to clear, the JSFiddle works on load. We should replace these with spaces when we extract the CSS.
Rather than opening a new bug, I'm adjusting the title to focus on the root cause. The code sample extractor [1] will need an additional code to handle this case, where there was a previous fix for bug 819999.
Summary: clicking OPEN IN JSFIDDLE/CODEPEN button may copy wrong contents to jsfiddle/codepen → Samples opened in JSFiddle will fail if CSS includes HTML escapes like  
Could it be browser related ? I can't seem to reproduce neither on Nightly or in Google Chrome.
(In reply to Anthony from comment #4) > Could it be browser related ? I can't seem to reproduce neither on Nightly > or in Google Chrome. Nevermind, I'm being stupid.
I was wrong, it is not the code sample extractor. The JSFiddle / Codepen code loads the content from the webpage, and it is wiki-samples.js [1] that needs the fix. [1] https://github.com/mozilla/kuma/blob/master/kuma/static/js/wiki-samples.js#L57-L72
Commits pushed to master at https://github.com/mozilla/kuma https://github.com/mozilla/kuma/commit/58dd9b028a9cb98434050fbb1bc42bb2db2c953a Fix bug 1284781 https://github.com/mozilla/kuma/commit/5b755d825fcb31aed26d80b36bc7bf487e94c840 Merge pull request #3904 from MatonAnthony/bug-1284781 Fix bug 1284781 Samples opened in JSFiddle will fail if CSS includes HTML escapes like  
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
See Also: → 1539076
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.