Topic on Help talk:Extension:Linter/tidy-whitespace-bug

Jump to navigation Jump to search
SSastry (WMF) (talkcontribs)

See T134423#3578633 where @Dvorapa asked how to fix Šablona:Fotbalbox2. Specifically this snippet:

<span style="white-space:nowrap; display:inline;">'''{{#if: {{{skóre|}}} | {{{skóre}}} | v }}''' {{#if:{{{prodl|}}}|<span style="font-size: 85%">([[Prodloužení|prodl.]])</span> }}</span>.

Solution 1:

One simple fix would be to add a whitespace char at the end of closing </span> if the extra whitespace character won't affect rendering.

<span style="white-space:nowrap; display:inline;">'''{{#if: {{{skóre|}}} | {{{skóre}}} | v }}''' {{#if:{{{prodl|}}}|<span style="font-size: 85%">([[Prodloužení|prodl.]])</span> }}</span> . Note that single extra whitespace char at the end.

Solution 2:

Alternatively, here is the fix that preserves existing whitespace.

<span style="white-space:nowrap; display:inline;">'''{{#if: {{{skóre|}}} | {{{skóre}}} | v }}'''{{#if:{{{prodl|}}}| <span style="font-size: 85%">([[Prodloužení|prodl.]])</span>}}</span> .

Reply to "Example fix"