Content deleted Content added
→L switch throwing Linter errors when value ends with a closing italics tag: Thanks to User:Freelance Intellectual for the workaround |
|||
(12 intermediate revisions by 5 users not shown) | |||
Line 21:
{{archive box | auto=yes }}
__TOC__
== The unnamed parameter ==
Line 79 ⟶ 29:
::{{re|Folly Mox|Toadspike}} I agree that this is confusing behaviour. It looks like the module currently only processes an unnamed argument at the end, on lines 287-309, in the case that it has not constructed any output. This section of code also duplicates some of the code earlier in the module, which is bad practice. As well as fixing the problem above, it would also be simpler and more maintainable to remove this section of code and instead map {{para|1}} to {{para|c}} at the beginning (e.g. just after line 103, where two other aliases are defined). [[User:Freelance Intellectual|Freelance Intellectual]] ([[User talk:Freelance Intellectual|talk]]) 15:37, 22 April 2025 (UTC)
== no-merging s and t ==
Line 102 ⟶ 48:
I had a momentary confusion on the article ''[[Captain of Destiny]]'' where it sort of looks like "literally" doesn't apply to the Chinese text. I've since edited it to clarify, but look at the [[Special:Permalink/1224678293|previous version]] to see what I mean. I skimmed the template documentation but didn't see a reason given. — [[User:W.andrea|W.andrea]] ([[User talk:W.andrea|talk]]) 14:48, 1 May 2025 (UTC)
:The semicolon was outside of the template in the previous version. How would this template or its documentation affect that situation? In your updated version, you have used the {{para|l}} parameter, but I would have put "Cheung Po the Kid" as the value, per the linked article. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 17:47, 1 May 2025 (UTC)
::Sorry, I don't think you understand what I'm asking: For most languages, things are separated by commas, while different languages are separated by semicolons, e.g. {{tqb|{{langx|fr|maison|lit=house}}; {{langx|es|casa|lit=house}}}} Why does this template use semicolons instead of commas? e.g. {{tqb|{{zh|c=房屋|l=house}}}} For a counter-example, {{tlx|langx}} uses commas: {{tqb|{{langx|zh|房屋|lit=house}}}} — [[User:W.andrea|W.andrea]] ([[User talk:W.andrea|talk]]) 13:44, 2 May 2025 (UTC)
::{{tqbm|The semicolon was outside of the template in the previous version. How would this template or its documentation affect that situation?}} Oh sorry, I might have misunderstood what you meant by this. Yes the semicolon was outside the template, but it was following the convention of the template, and after editing, the semicolon is inside the template. — [[User:W.andrea|W.andrea]] ([[User talk:W.andrea|talk]]) 13:51, 2 May 2025 (UTC)
::{{tqbm|In your updated version, you have used the {{para|l}} parameter, but I would have put "Cheung Po the Kid" as the value, per the linked article.}} I just used what was already there and it's the title of the linked article. I don't speak Chinese anyway so I wouldn't feel comfortable changing it. But this is beside the point of my question. — [[User:W.andrea|W.andrea]] ([[User talk:W.andrea|talk]]) 13:53, 2 May 2025 (UTC)
:::I see what you mean. This module appears to separate each parameter with semicolons. The list of parameters in lines 18–52 are undifferentiated. I think someone would have to adjust the module code to precede "lit." with a comma. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 17:24, 2 May 2025 (UTC)
== L switch throwing Linter errors when value ends with a closing italics tag ==
Just noticed this on the [[Mangtong]] page while clearing old "missing end tag" errors:
{|-
!Code...
|
!Renders as...
|-
|<code><nowiki>A modernized version of the ''mangtong'', called ''gǎigé mángtǒng'' ( {{zh|c=改革芒筒|l=reformed ''mangtong''}}), was developed in the 20th century.</nowiki></code>
|
|A modernized version of the ''mangtong'', called ''gǎigé mángtǒng'' ( {{zh|c=改革芒筒|l= reformed ''mangtong''}}), was developed in the 20th century.
|}
It seems like passing a value ending with an italicized value via the <code>l=</code> parameter throws the Linter error. Adding a   or equivalent parameter after the closing italics tag won't resolve the error...
{|-
|<code><nowiki>A modernized version of the ''mangtong'', called ''gǎigé mángtǒng'' ( {{zh|c=改革芒筒|l=reformed ''mangtong'' }}), was developed in the 20th century.</nowiki></code>
|
|A modernized version of the ''mangtong'', called ''gǎigé mángtǒng'' ( {{zh|c=改革芒筒|l= reformed ''mangtong'' }}), was developed in the 20th century.
|-
|<code><nowiki>A modernized version of the ''mangtong'', called ''gǎigé mángtǒng'' ( {{zh|c=改革芒筒|l=reformed ''mangtong''{{nbsp}}}}), was developed in the 20th century.</nowiki></code>
|
|A modernized version of the ''mangtong'', called ''gǎigé mángtǒng'' ( {{zh|c=改革芒筒|l= reformed ''mangtong''{{nbsp}}}}), was developed in the 20th century.
|-
|<code><nowiki>A modernized version of the ''mangtong'', called ''gǎigé mángtǒng'' ( {{zh|c=改革芒筒|l=reformed ''mangtong'' }}), was developed in the 20th century.</nowiki></code>
|
|A modernized version of the ''mangtong'', called ''gǎigé mángtǒng'' ( {{zh|c=改革芒筒|l= reformed ''mangtong'' }}), was developed in the 20th century.
|}
The only solution appears to be if a non-apostrophe/non-quotation after the close-italics tag but before the }}:
{|-
|<code><nowiki>A modernized version of the ''mangtong'', called ''gǎigé mángtǒng'' ( {{zh|c=改革芒筒|l=′reformed ''mangtong''′}}), was developed in the 20th century.</nowiki></code>
|
|A modernized version of the ''mangtong'', called ''gǎigé mángtǒng'' ( {{zh|c=改革芒筒|l=′reformed ''mangtong''′}}), was developed in the 20th century.
|}
...which seems a bit of a hack.
Interestingly, attempting to italicize the entire value results in both italics tags being ignored (same as when leaving italics tags out altogether)...
{|-
|<code><nowiki>A modernized version of the ''mangtong'', called ''gǎigé mángtǒng'' ( {{zh|c=改革芒筒|l=''reformed mangtong''}}), was developed in the 20th century.</nowiki></code>
|
|A modernized version of the ''mangtong'', called ''gǎigé mángtǒng'' ( {{zh|c=改革芒筒|l=''reformed mangtong''}}), was developed in the 20th century.
|-
|<code><nowiki>A modernized version of the ''mangtong'', called ''gǎigé mángtǒng'' ( {{zh|c=改革芒筒|l=reformed mangtong}}), was developed in the 20th century.</nowiki></code>
|
|A modernized version of the ''mangtong'', called ''gǎigé mángtǒng'' ( {{zh|c=改革芒筒|l=reformed mangtong}}), was developed in the 20th century.
|}
Any chance this can be fixed?
[[User:SirOlgen|SirOlgen]] ([[User talk:SirOlgen|talk]]) 16:28, 21 August 2025 (UTC)
:So to put it in non-Lint terms, it doesn't appear as though this template's "literal" parameter is properly handling italics tags which occur either first or last in the passed string. [[User:SirOlgen|SirOlgen]] ([[User talk:SirOlgen|talk]]) 18:09, 21 August 2025 (UTC)
::Yes, see this previous discussion: [[Module_talk:Lang-zh/Archive_5#Trailing_bold_in_l=_not_being_removed]]. A workaround is to use HTML italic tags, e.g. <code><nowiki>{{zh|l=reformed <i>mangtong</i>}}</nowiki></code> for {{zh|l=reformed <i>mangtong</i>}}. The stripping of bold and italic markup is commented in the code but not mentioned in the template documentation. At the time of the previous discussion, I wasn't convinced that stripping quotation marks was necessary, but I also didn't know of any use cases where it would cause a problem and so I didn't push the point further. However, this looks like a valid use case, and I think we should revisit the question of why quotes should be stripped. In contrast, this doesn't happen for {{tl|lit}}, which otherwise has extremely similar functionality to the {{para|l}} parameter. [[User:Freelance Intellectual|Freelance Intellectual]] ([[User talk:Freelance Intellectual|talk]]) 21:57, 22 August 2025 (UTC)
:::Thanks a million for the background info and workaround (I'm embarrassed for not having thought to try that, LOL). This does seem like a pretty obscure use case, but it also seems a near certainty there will be more examples out there among the 1.9M outstanding "[[Special:LintErrors/missing-end-tag|missing end tag]]" errors.
:::Thanks again!
:::[[User:SirOlgen|SirOlgen]] ([[User talk:SirOlgen|talk]]) 02:11, 24 August 2025 (UTC)
|