Wikipedia talk:WikiProject U.S. Roads/Redirects/Alaska/Route list

Latest comment: 3 years ago by Morriswa in topic Misnested tags
WikiProject iconU.S. Roads: Alaska Project‑class
WikiProject iconThis page is within the scope of the U.S. Roads WikiProject, an attempt to build a comprehensive and detailed guide to state highways and other major roads in the United States. If you would like to participate, you can edit the article attached to this page, or visit the project page, where you can join the project and/or contribute to the discussion.
ProjectThis page does not require a rating on the project's quality scale.
Locations
 Alaska  
 
WikiProject iconAlaska Project‑class
WikiProject iconThis page is within the scope of WikiProject Alaska, a collaborative effort to improve the coverage of the U.S. state of Alaska on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
ProjectThis page does not require a rating on Wikipedia's content assessment scale.

Misnested tags edit

Morriswa: You may already know about this, but this template is generating misnested tags and stripped tags lint errors. For example, in Wikipedia:WikiProject U.S. Roads/Redirects/Alaska, *{{/Route list|98}} expands to *{{Wikipedia:WikiProject U.S. Roads/Redirects/Alaska/Route list|98}}, which expands to

*<small>[[File:Alaska 98 shield.svg|25x20px]] </span>
<span>[[Alaska Route 98]] [[Route 98 (Alaska)]] [[Alaska State Highway 98]] [[Alaska State Route 98]]</span> [[List of highways numbered 98|disambiguation]]
</small>

If not for the asterisk, <small>...</small> would be OK, but because of the asterisk, the opening <small> is within a <li>...</li> generated by the asterisk, while the closing </small> is outside <li>...</li>. This can be fixed either by moving the <small> to start on the line after the file(s), or by removing all of the line breaks. The stripped </span> at the end of the first line is obvious in this case; the code will have to be rewritten to tighten the matching of opening and closing <span>...</span> tags. —Anomalocaris (talk) 23:04, 18 March 2021 (UTC)Reply

And, of course, whatever fix you do here should be propagated to similar "Templates" in the Wikipedia namespace you have created. —Anomalocaris (talk) 23:11, 18 March 2021 (UTC)Reply

Did I mess anything up? I know nothing about Lint (or is it Linter?). I just used code from other state pages and modified it for the state in question. I think I did something weird, since each entry (when it extrapolates out) should be on one line, not two. Morriswa (Charlotte Allison) (talk) 23:13, 18 March 2021 (UTC)Reply

Morriswa: Thank you for replying so quickly! I didn't guess that you simply copied code from other "templates" created by other Wikipedia editors. Which template was the source of this markup? Just let me know that and I'll take it from there. As for lint, yes, this is a real issue in Wikipedia. Some lint errors don't matter very much, but markup with misnested tags might not do what you expect. For example, the markup

[[The Beatles|<small>A popular British music group]] that wrote "[[I Want to Hold Your Hand]]"</small>

has a missing end tag for the opening <small> inside the wikilink and a stripped closing </small> at the end. Perhaps the author actually intended one of these:

<small>[[The Beatles|A popular British music group]] that wrote "[[I Want to Hold Your Hand]]"</small>
[[The Beatles|<small>A popular British music group</small>]] that wrote "[[I Want to Hold Your Hand]]"
[[The Beatles|A popular British music group]] <small>that wrote "[[I Want to Hold Your Hand]]"</small>

By careful placement of tags, one avoids lint errors and there is no doubt what one intended. —Anomalocaris (talk) 23:54, 18 March 2021 (UTC)Reply

Most of the "Wikipedia:WikiProject U.S. Roads/Redirects" pages don't actually use templates. They call the code on a subpage from that state/territory. I just copied the code from one of them. I don't remember which. All I know is that every page should have some form of uniformity and commonality. Morriswa (Charlotte Allison) (talk) 00:09, 19 March 2021 (UTC)Reply