Jump to content

User talk:YBG/Living officeholders/row5

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

div-span-flip lint error

[edit]
To be Cut+Pasted from User talk:YBG/Living officeholders/row5 to User talk:YBG

User:YBG: This template generates a div-span-flip lint error each time it is used. For example, in User:YBG/Living officeholders/usvp-table, the line

{{User:YBG/Living officeholders/row|fmt=M j, Y |job=usvp |evt1=-42 |evt2= |49|48|47|46|45|44}}

can be expanded using Special:ExpandTemplates, showing markup with the div-span-flip selected here:

<span data-sort-value="z !"><div class="plainlist"><ul><li>'''<span style="color: red;">–</span>'''<span style="text-align:center;display:inline-block;width:1.5em;background-color:#ffffb3;font-weight:bold;color:black">[[Walter Mondale|42]]</span></li></ul></div> </span>

The lint error can be corrected by changing the markup to

<div class="plainlist"><ul><li><span data-sort-value="z !">'''<span style="color: red;">–</span>'''<span style="text-align:center;display:inline-block;width:1.5em;background-color:#ffffb3;font-weight:bold;color:black">[[Walter Mondale|42]]</span></span></li></ul></div>

However I don't understand the workings of User:YBG/Living officeholders/usvp-table, so I leave it to you to figure out how to fix your page. —Anomalocaris (talk) 19:31, 25 May 2021 (UTC)[reply]

@Anomalocaris: I'm not sure I understand what the problem is with the expanded markup. Here it is with newlines added:
   <span data-sort-value="z !">
       <div class="plainlist">
           <ul>
               <li>'''
                   <span style="color: red;">
                       –
                   </span>'''
                   <span style="text-align:center;display:inline-block;width:1.5em;background-color:#ffffb3;font-weight:bold;color:black">
                       [[Walter Mondale|42]]
                   </span>
               </li>
           </ul>
       </div> 
   </span>
It seems to me that the nesting perfectly balanced.
  • Inside the outermost <span>...</span> is a <div>...</div>
  • Inside the <div>...</div> is a <ul>...</ul>
  • Inside the <ul>...</ul> is a <li>...</li>
  • Inside the <li>...</li> is <span>...</span><span>...</span>
But maybe I'm missing something here. YBG (talk) 05:28, 26 May 2021 (UTC)[reply]
@Anomalocaris: Re-pinging due to typo. YBG (talk) 05:31, 26 May 2021 (UTC)[reply]
YBG: You're right that there is no problem with misnested tags. The problem is that <span>...</span> is not supposed to wrap <div>...</div>. In many cases, the display is exactly what you want, but it's still considered an error. For more on this topic, see MW:Help:Lint_errors/misc-tidy-replacement-issues. —Anomalocaris (talk) 06:17, 26 May 2021 (UTC)[reply]

YBG: At this point there are 92 div-span-flip lint errors in User namespace. Of those:

  • 3 are in protected pages that can be edited only by administrators
  • 3 are in two inscrutable pages that I have given up on, for now
  • 86 are in pages by you, involving User:YBG/Living officeholders/row.

It would be great if you could figure out the problem. Tools that are helpful for fixing lint errors include Special:ExpandTemplates and lintHint. You can find out about lintHint at Wikipedia:Linter. —Anomalocaris (talk) 07:16, 28 May 2021 (UTC)[reply]

YBG: At this point there are 92 div-span-flip lint errors in User namespace. Of those:

It would be great if you could figure out the problem. Tools that are helpful for fixing lint errors include Special:ExpandTemplates and lintHint. You can find out about lintHint at Wikipedia:Linter. —Anomalocaris (talk) 07:23, 28 May 2021 (UTC)[reply]

It should be all fixed now.
This is the snipped that caused the problem {{sort|sortkey|{{ubl|item1|item2}}}}
It could have been fixed by changing it to this: {{sort|sortkey|}}{{ubl|item1|item2}}
But, the sort wasn't needed so I changed it to this: {{ubl|item1|item2}}
In a few days, I'm going to cut-paste this discussion into my talk page, where it probably should have occurred in the first place. Thank you for your assistance and especially for your patience. YBG (talk) 07:43, 29 May 2021 (UTC)[reply]
@Anomalocaris:: By the way, the error counts were way off. The page User:YBG/Living officeholders/row was actually transcluded 493 times from six different pages, including one that was not listed. And most of the pages it listed were listed twice, once with 11 errors and once with 10 errors, which explains why your list mentioned one of the pages twice. Here are the number of errors listed and the actual number, based on the number of times the page was transcluded:
Thanks again. YBG (talk) 08:09, 29 May 2021 (UTC)[reply]