Editing
Project:Village pump (technical)
(section)
From Thetacola Wiki
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Div problems? == The behavior at [[Wikipedia talk:Manual of Style#Wikilawyering over passive voice]] surprised me. Maybe [[Template:Archive top]] is incompatible with {{tag|poem}}? [[User:WhatamIdoing|WhatamIdoing]] ([[User talk:WhatamIdoing|talk]]) 15:43, 12 August 2022 (UTC) :The poem tag is buggy. It wants to close a div early when being indented. :See [https://en.wikipedia.org/w/index.php?title=User:0xDeadbeef/sandbox&oldid=1104091488]. <syntaxhighlight lang="html"> <div class="test"> Agreed :<poem>foo</poem> True </div> </syntaxhighlight> Generates <syntaxhighlight lang="html"> <div class="test"> <p>Agreed </p> <dl><dd><div class="poem"></div></dd></dl> <p>foo </p> </div> <p>True </p> </syntaxhighlight> <span style="font-family:Iosevka,monospace">0x[[User talk:0xDeadbeef#top|<span style="text-transform:uppercase;color:black">'''Deadbeef'''</span>]]</span> 16:00, 12 August 2022 (UTC) ::{{tag|div}} tags don't belong in {{tag|dd}} definition list markup. To indent {{tag|poem}} tags, this works: <syntaxhighlight lang="html" style="margin-left:1.6em"><div class="test"> Agreed <poem style="margin-left:1.6em">foo</poem> True </div></syntaxhighlight> which gives: <syntaxhighlight lang="html" style="margin-left:1.6em"><div class="mw-parser-output"><div class="test"> <p>Agreed </p> <div style="margin-left:1.6em" class="poem"> <p>foo </p> </div> <p>True </p> </div></div></syntaxhighlight> β[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 16:37, 12 August 2022 (UTC) :::{{replyto|WhatamIdoing}} The fix was {{diff|Wikipedia talk:Manual of Style|prev|1104210986|somewhat simpler}}. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] 🌹 ([[User talk:Redrose64|talk]]) 13:26, 13 August 2022 (UTC) ::::There's nothing simple about that, unless you mean "The fix was asking you to fix it for me". <code>;-)</code> Thank you for your help. [[User:WhatamIdoing|WhatamIdoing]] ([[User talk:WhatamIdoing|talk]]) 17:50, 13 August 2022 (UTC) :::::The addition of the <code>style="margin-left: 1.6em;"</code> attribute has nothing to do with the real fix, which was to remove the colon. That style attribute is there merely to simulate the indent that the colon had been intended to carry out. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] 🌹 ([[User talk:Redrose64|talk]]) 19:36, 13 August 2022 (UTC) :::{{replyto|Trappist the monk}} There is nothing wrong with {{tag|div}} tag in {{tag|dd}} definition list markup; this is demonstrated by the above use of {{tag|syntaxhighlight}} (which emits a div) following one or two colons perfectly satisfactorily (if you were to enclose this thread in {{tlx|atop}}/{{tlx|abot}} there would be no breakage). Indeed, the HTML spec explicitly allows [https://html.spec.whatwg.org/multipage/grouping-content.html#the-dd-element a <code>dd</code> element] to contain flow content, and [https://html.spec.whatwg.org/multipage/grouping-content.html#the-div-element a <code>div</code> element] <q>can be used where flow content is expected</q>. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] 🌹 ([[User talk:Redrose64|talk]]) 13:37, 13 August 2022 (UTC) ::::If you all settle things and decide that there needs to be a change, then I'm willing to write up any needed Phab tickets, but I think you'll need to tell me what to say. [[User:WhatamIdoing|WhatamIdoing]] ([[User talk:WhatamIdoing|talk]]) 17:51, 13 August 2022 (UTC) :::::The bug will be in [[mw:Extension:Poem|the poem extension]], but I'm not a PHP coder. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] 🌹 ([[User talk:Redrose64|talk]]) 19:39, 13 August 2022 (UTC) ::::Perhaps I think that {{tag|div}} tags don't belong in {{tag|dd}} definition list tags because {{tlx|reflist talk}} (which is wrapped in {{tag|div}} tags) doesn't work in indented discussions. Here is a {{tag|ref|content=some text}}:<ref>some text</ref> ::::{{reflist talk}}<!-- don't fix this --> ::::[[Special:ExpandTemplates]] gives this: :::::<syntaxhighlight lang="html"><div class="mw-parser-output"><p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[1]</a></sup> </p> <dl><dd><dl><dd><dl><dd><dl><dd><style data-mw-deduplicate="TemplateStyles:r1044749286">.mw-parser-output .reflist-talk{margin:auto 2em;border:1px dashed #AAAAAA;padding:4px;padding-left:1em}.mw-parser-output .reflist-talk-title{font-weight:bold}</style><div class="reflist-talk"></div></dd></dl></dd></dl></dd></dl></dd></dl> <p class="reflist-talk-title">References</p> <style data-mw-deduplicate="TemplateStyles:r1011085734">.mw-parser-output .reflist{font-size:90%;margin-bottom:0.5em;list-style-type:decimal}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}</style><div class="reflist"> <div class="mw-references-wrap"><ol class="references"> <li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text">some text</span> </li> </ol></div></div> </div></syntaxhighlight> ::::What actually renders in my browser is this: :::::<syntaxhighlight lang="html"><dd><style data-mw-deduplicate="TemplateStyles:r1044749286">.mw-parser-output .reflist-talk{margin:auto 2em;border:1px dashed #AAAAAA;padding:4px;padding-left:1em}.mw-parser-output .reflist-talk-title{font-weight:bold}</style><div class="reflist-talk"></div></dd></dl></dd></dl></dd></dl></dd></dl> <p class="reflist-talk-title">References</p> <style data-mw-deduplicate="TemplateStyles:r1011085734">.mw-parser-output .reflist{font-size:90%;margin-bottom:0.5em;list-style-type:decimal}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}</style><div class="reflist"> <div class="mw-references-wrap"><ol class="references"> <li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text">some text</span> </li> </ol></div></div></syntaxhighlight> ::::Is it the [https://html.spec.whatwg.org/multipage/semantics.html#the-style-element style element] (which is not [https://html.spec.whatwg.org/multipage/dom.html#flow-content flow content]) that breaks this (common) use case? ::::β[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 11:58, 14 August 2022 (UTC) :::::No, it's the part of the MediaWiki software that nowadays does the job that was formerly carried out by [[HTML Tidy]]. What seems to happen is that if all of the "untidy" HTML is on one line, the tidying routines are happy. If you have <syntaxhighlight lang=moin><poem>Line one Line two</poem></syntaxhighlight> placed hard left, what this generates is <syntaxhighlight lang=html><div class="poem"> <p>Line one<br> Line two </p> </div></syntaxhighlight> and if we take that, remove all the newlines, and indent it, it works as expected: :::::<div class="poem"><p>Line one<br />Line two</p></div> :::::But if there's a newline in there somewhere (it doesn't really matter where), some of the end tags are moved from their correct position to a point that is semantically too early, thus terminating certain elements that should have been left open. Consider this simple example: :::::<div>This is a div and it's formatted correctly</div> :::::<div>This is a div and it's broken</div> :::::The MediaWiki software is assuming that the newline should terminate the div and the five enclosing dl/dd pairs, and that the phrase "and it's broken" should be enclosed in {{tag|p}} tags. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] 🌹 ([[User talk:Redrose64|talk]]) 16:25, 14 August 2022 (UTC) ::::::I stripped all of the newlines out of {{tlx|reflist-talk/sandbox}} and got the same result as the live version above so if the issue is newlines, it doesn't appear to be fixable by tweaking the template. ::::::β[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 16:55, 14 August 2022 (UTC)
Summary:
Please note that all contributions to Thetacola Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Project:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Project page
Discussion
Read
Edit source
History
Page actions
Project page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Tools
What links here
Related changes
Special pages
Page information