Topic on User talk:星耀晨曦

Edited needed for zhwiki for Template:nowrap begin

23
Summary by 星耀晨曦

EP has been accepted and work good.

SSastry (WMF) (talkcontribs)

That template needs to change from

<includeonly><span class="nowrap"></includeonly>

to

<includeonly><nowiki/>\n<span class="nowrap"></includeonly>

The \n is a newline. This will fix the pwrap-wrapping-bug linter errors on a lot of templates and pages.

SSastry (WMF) (talkcontribs)

It needs a <nowiki/> still. See above. Otherwise, the parser will strip the newline.

星耀晨曦 (talkcontribs)
SSastry (WMF) (talkcontribs)

Ah, I hadn't seen zh:Template:nowrap ... I am not sure how Template:nowrap is being used. I'll have to take a look at pages using it. I'll check tomorrow. But, I was referring to zh:Template:nowrap begin

星耀晨曦 (talkcontribs)

Ok, I will request for editing again.

星耀晨曦 (talkcontribs)

The zhwiki administrator does not think that this template should be modified. It says that this template will not cause lint errors, the lint error occurs because of incorrect use of this template, not a problem with this template.

Can you give an example to illustrate that the code of zh:Template:nowrap begin will cause lint errors?

SSastry (WMF) (talkcontribs)

Take a look at https://zh.wikipedia.org/wiki/Template:%E9%87%91%E6%9B%B2%E7%8D%8E%E6%9C%80%E4%BD%B3%E7%B7%A8%E6%9B%B2%E4%BA%BA%E7%8D%8E?action=parsermigration-edit - you have to open the collapsed tables to see the problem.

Now, in that edit window in that url above, add a <nowiki/>\n before the use of {{nowrap begin}} in all instances. You will see that the problem goes away. This is a workaround for a parser bug. A simpler way instead of fixing all uses of {{nowrap begin}} is to add the <nowiki/>\n in this template itself.

k

星耀晨曦 (talkcontribs)
SSastry (WMF) (talkcontribs)
SSastry (WMF) (talkcontribs)
星耀晨曦 (talkcontribs)

I noticed zh:T:Navbox, which outputs various types (multiple-unclosed-formatting-tags, pwrap-bug-workaround) of lint errors, and this template was called many times.

SSastry (WMF) (talkcontribs)

That is usually because of how the navbox template is used in those other templates.

星耀晨曦 (talkcontribs)
SSastry (WMF) (talkcontribs)

Regarding, nowrap begin, yes, looks like you will need an equivalent fix in nowrap end as well to add a "<nowiki/>\n" after the </span>. So, it will become <nowiki/>\n</span>

So, you need both, it appears.

The alternative is to fix templates so that {{nowrap begin}}, all those {{.w}} templates and {{nowrap end}} are all on the same line.

星耀晨曦 (talkcontribs)

This caused another style destruction, see test reset.

SSastry (WMF) (talkcontribs)
星耀晨曦 (talkcontribs)

Feedback from community member: {{}} was style broken. He used {{nowrap}} instead of {{nowrap_begin}}...{{nowrap_end}} to fix.

SSastry (WMF) (talkcontribs)

I see .. ok. Thanks for pursuing this.

星耀晨曦 (talkcontribs)

It looks like it's no problem, wrong used {{nowrap_begin}}...{{nowrap_end}}.

星耀晨曦 (talkcontribs)

Hi, I also received feedback from a user. In the infobox for zh:在河左岸, "主演", "制作公司", "播出日期", there text of the parameters looks strange, more out of a <p> pair in the outer layer.

SSastry (WMF) (talkcontribs)

Is this related to the nowrap templates? Or, are you reporting something else?

星耀晨曦 (talkcontribs)

See test case, maybe the nowrap templates is not compatible with some templates?

SSastry (WMF) (talkcontribs)

Hmm .. I see. Yes, so, the newlines added to the nowrap-begin and nowrap-end is causing this. This is a result of how p-wrappers are added in the parser for <td>s.

So, if you don't want this to happen, you have the following options:

  1. Option 1: Let that spacing be as is.
  2. Option 2: Fix that spacing problem some other way (ex: maybe CSS).
  3. Option 3: You have to revert changes to nowrap-begin and nowrap-end. After that you will have to make fixes similar to this to all the templates that will show up in this linter category after the revert.
Reply to "Edited needed for zhwiki for Template:nowrap begin"