Hi. Open some page for source edit and add "{{some js or css or json or lua page}}". It looks terrible, especially json. I believe it should be fixed or at least prevented at all until the fix. Thank you.
For example: | When transcluded: |
IKhitron | |
Sep 27 2016, 2:09 PM |
F4538077: pasted_file | |
Sep 29 2016, 8:12 PM |
F4538081: pasted_file | |
Sep 29 2016, 8:12 PM |
Hi. Open some page for source edit and add "{{some js or css or json or lua page}}". It looks terrible, especially json. I believe it should be fixed or at least prevented at all until the fix. Thank you.
For example: | When transcluded: |
The Content class has a getWikitextForTransclusion() method, possibly CssContent/JavaScriptContent/JsonContent should override it with… something.
Well, @matmarex, what do you think about (in pseudocode)
return $('<syntaxhighlight>', {lang: 'css', html: super()});
will it work?
Yes, basically, with two caveats:
Parsoid would probably also need something done here, if only replacing whatever it currently does to get the wikitext for a transclusion with something that calls getWikitextForTransclusion(). And in turn that might need some change to the action API.
Parsoid calls the expandtemplates action api endpoint, so as long as that does the right thing, this should work in Parsoid.