Jump to content

Help talk:Lint errors/tidy-whitespace-bug

About this board

Amire80 (talkcontribs)
IKhitron (talkcontribs)

Thanks for tagging. What is #text at all?

SSastry (WMF) (talkcontribs)

#text is a text node. Anyway, this one is harder to track because of the unclosed <div> tag in the opening template which pretty much makes all lint errors useless since it doesn't give you source offsets. We'll have to figure out if there is a non-hacky way in Parsoid we can look inside the template-wrapped content to resolve this better.

Anyway, after playing around with it, the issue is with {{ללא גלישה| כ"{{ Mediawiki:Gadget-Checkty}}" ) }}נותן. The outer template is generating a span tag with nowrap css, and ends in a whitespace (from the template argument). The following string after the argument will not break a line with Remex. But, Tidy moves the white-space out of the span tag which gives the browser an opportunity to break the line. But, in practice, for this instance, this is a problem only for not-wide-enough screens which it is for me in the parsermigration-edit view. Look for the red wikEd string in your browser. You will see that the remex view is a bit wider than Tidy. But, if I reduce the browser font-size a little bit, this difference goes away. So, this is not a big deal in this case. But, if you wanted to fix it, you can move the whitespace that is right now after the ')' to after the '}}'. But, you can ignore this as well.

Reply to "Tips to finding it?"

Not useful on enWS transcluded page sets

3
Billinghurst (talkcontribs)
Billinghurst (talkcontribs)

As a question, is it the use of &nbsp; inside the span or abbr tags that is the issue?

SSastry (WMF) (talkcontribs)

Ya, we'll have to take a look at this to see how we can improve the error reporting here. I don't know offhand. I'll take a look tomorrow and get back.

Reply to "Not useful on enWS transcluded page sets"
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"
There are no older topics