Page MenuHomePhabricator

JavaScript preview doesn't work with source tag
Closed, ResolvedPublic

Description

Steps:

  1. Enable JavaScript preview.
  2. To an empty page add something in a source tag e.g.

<source lang="css">
li[id^="pt-prefswitch-"],
li[id^="pt-optin-"]
{display:none !important}
</source>

  1. Run preview.

Expected:
Same preview as without JS.

Result:
The text seem to be unparsed.

This is because geshi extension produces CSS for the language inside the generated page and JS preview. You might say this is a bug in geshi, but geshi works fine without JS and there might be more cases like that with other extensions.


Version: 1.16.x
Severity: normal

Details

Reference
bz24843

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:00 PM
bzimport set Reference to bz24843.

JS preview doesn't load everything it needs, like the CSS. I don't understand why the option to enable it is shown by default.

For this to work, the common/preview.js script would need to be switched to use the api.php parse with "headitems" option I think.

  • This bug has been marked as a duplicate of bug 24134 ***