Page MenuHomePhabricator

Investigate: Why is comment wrapped in nowiki tags?
Closed, ResolvedPublic

Description

Scenario

Observe how this comment is wrapped in <nowiki> tags.

I suspect We've confirmed this was not intentional as evidenced by this person removing the tags in their next edit and stating it explicitly here: https://w.wiki/Ubv.

Open questions

Done

  • "Open questions" are answered
  • If this scenarios is caused by an issue in the software, a task is filed to resolve this issue

Event Timeline

The user typed and signed their message in visual mode. To reproduce this type:
Hello ~~~~
in visual mode and switch to source mode.

There should be a wikitext warning when you type ~~~~ but that doesn't appear to be showing.

We may want to be more aggressive with ~~~~ in visual mode, however we must bear in mind that "You can sign your comments with ~~~~" should be a valid message to type in visual mode.

The warning is not showing because we don't load the signature tool on DT yet. I'm not sure we would want to though as the way the tool currently works is:

If the current namespaces is a talk namespace or an extraSignaturesNamespace then:

  • Load the signature tool, and when ~~~~ is typed replace it with a focusable signature node

otherwise

  • When '~~~~' is typed just show a wikitext warning in the top right of the screen.

We can't really do the same thing we do in source mode, which is show the user the signature is going to be removed in the preview, because there is no separate preview.

Change 607091 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/DiscussionTools@master] [WIP] Detecting typed signatures in visual mode

https://gerrit.wikimedia.org/r/607091

I had a half-complete patch for this locally for a while, so I thought I'd push it to inform the conversation. I think the interface with the signature nodes is not too bad.

I had a half-complete patch for this locally for a while, so I thought I'd push it to inform the conversation. I think the interface with the signature nodes is not too bad.

Let's talk about the above here: T255738#6247156.

The user typed and signed their message in visual mode. To reproduce this type:
Hello ~~~~
in visual mode and switch to source mode.

To confirm: is it expected for the entirety of a person's comment to be wrapped in <nowiki>...</nowiki> if they write and publish a comment using the tool's visual mode that includes ~~~~?

If "yes," we can resolve this particular task and then finalize the details of a fix [1][2] for this behavior in T255738.


There should be a wikitext warning when you type ~~~~ but that doesn't appear to be showing.

We may want to be more aggressive with ~~~~ in visual mode, however we must bear in mind that "You can sign your comments with ~~~~" should be a valid message to type in visual mode.

I had a half-complete patch for this locally for a while, so I thought I'd push it to inform the conversation. I think the interface with the signature nodes is not too bad.

The user typed and signed their message in visual mode. To reproduce this type:
Hello ~~~~
in visual mode and switch to source mode.

To confirm: is it expected for the entirety of a person's comment to be wrapped in <nowiki>...</nowiki> if they write and publish a comment using the tool's visual mode that includes ~~~~?

If "yes," we can resolve this particular task and then finalize the details of a fix [1][2] for this behavior in T255738.

Confirmed: @Esanders indicated the placement of <nowiki> tags is something the perser decides; if we think the behavior should be changed, we can make a case for that; however, this behavior does not currently need to be changed.

ppelberg claimed this task.

Hi, I don't know if it is relevant, but the tool has just wrapped a comment that I was responding to inside the <nowiki> tag. Here is the diff. Obviously I did not have direct editing access to the said comment while I was typing my reply.

@ppelberg : Is it relevant or should I create a new ticket for this particular issue?

The nowiki tags appeared because the comment contained template opening braces {{, and if closing braces }} were added elsewhere on the page, everything inbetween would become a broken template transclusion and not render correctly. So Parsoid adds <nowiki> to avoid that other kind of corruption.