Last modified: 2013-12-04 06:01:04 UTC
The code <syntaxhighlight lang="javascript" enclose="pre" highlight="2-3"> function doSomething() { var foo, bar; if (baz) { </syntaxhighlight> , which use tabs for indentation, is wrongly rendered as ---- function doSomething() { var foo, bar; if (baz) { ---- as you can check n the provided url. This shouldn't happen.
It looks like the tab->space conversion is done by HTML tidy -- and it's behaving a bit differently on the <pre> as it does on the <span>s? Probably it's resetting its conversion on each element. Probably the best way to fix this (other than turning off the damn conversion in tidy if we can) is to do our own tab->space conversion before passing things into syntax highlighting. Though it'd be nicer still to preserve the original tabs I guess... but tidy doesn't seem to want to do that. :P http://tidy.sourceforge.net/docs/quickref.html#tab-size says "Tidy never outputs tabs". whyyyyyyyyyyyyy
Done in r97300 -- applying the tab-to-space as a preprocess if tidy is enabled. Will need merge to 1.18 in which case it'll be in with the update deployments in the next couple weeks.
Change 98540 had a related patch set uploaded by Anomie: Protect tabs from HTML Tidy https://gerrit.wikimedia.org/r/98540
Change 98540 merged by jenkins-bot: Protect tabs from HTML Tidy https://gerrit.wikimedia.org/r/98540