Page MenuHomePhabricator

VisualEditor does not respect trailing chars
Closed, DuplicatePublic

Description

There is a list of characters that is allowed as trailing chars and should be merged to the internal link. This is not respected by VisualEditor and a hard <nowiki/> is inserted. This inserted <nowiki/> is almost always wrong. There is an example at this diff.

Event Timeline

jeblad created this task.Mar 13 2016, 1:52 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 13 2016, 1:52 PM
jeblad updated the task description. (Show Details)Mar 13 2016, 1:57 PM
Jdforrester-WMF closed this task as Invalid.Mar 13 2016, 2:18 PM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

It's entirely possible to make trailing links in editors that get turned into wikitext via Parsoid (i.e. [[Foo]]bar), including VisualEditor. However, Parsoid doesn't do this minor syntactical flourish, and instead writes them out as piped links (i.e. [[Foo|Foobar]]); fixing this is T50463: Parsoid: Links created with VE are piped links even when linktrail could be used but not a priority.

However, given the second sentence I think the problem you're identifying is that people sometimes ignore the target of a link despite the large, very clear 'context menu' showing where the link goes (see a large number of tasks and test results getting us to this place over the past four years) and the cartouche blue haze showing when the link's display text is being extended or not based on the position of the cursor (a more recent addition, provided about six months ago to wide contentment). At some point I think we may have to give up on achieving perfection here, as despite at least twenty pretty fundamental iterations of design we have never achieved (and probably will never achieve) a zero-user-error rate.

Note also the parallel issue, in which some users occasionally believe that there is a space between the link and the next word they're writing (and so a <nowiki /> gets inserted to separate the link from the next word); discussion about that is T128060: VisualEditor makes it easy to create partially linked words, when the user expects a fully linked one.

jeblad added a comment.EditedMar 13 2016, 6:03 PM

Note that this isn't about the cases where Parsoid write out the internal link as the piped style, it is about Parsoid not respecting the trailing chars. At nowiki we use trailing chars a lot, and for Parsoid to neglect this is a question of whether VisualEditor should be used or not. It is now one of the major reason why people don't use VE. I tend to think that T50463 is close to a show stopper for us.

Your example [[Foo]]bar isn't a good argument at nowiki and other Nordic languages, as this form is extremely common. We use a common word stem and add suffixes to that. We can actually add several suffixes to a word stem

  •  [[Hus]] (indefinite)
  • [[Hus]]a (indefinite)
  • [[Hus]]et (singular definite)
  • [[Hus]]ene (plural)
  • [[Hus]]enes (plural genetive)

But note

  • [[Bok]] (indefinite)
  • [[Bok]]a (definite) - note "a" isn't a marker for definitness
  • [[Bok|Bøker]] (plural indefinite)
  • [[Bok|Bøkene]] (plural definite)
  • [[Bok|Bøkenes]] (plural definite genetive)

Note for the two last ones that a redirect on [[Bøk]] is troublesome as this is actually a sort of three.

The current trailing chars does not include some important cases, like the use of an aposophe in genetive-s

  • [[FN]]s should be rendered similar to [[FN|FNs]]
  • [[Vinje]]s should be rendered similar to [[Vinje|Vinjes]]
  • [[Vesaas]]' should be rendered similar to [[Vesaas|Vesaas']]
  • [[Grete Waitz]]' should be rendered similar to [[Grete Waitz|Grete Waitz']]
  • [[Ap]]'s should be rendered similar to [[Ap|Ap's]]

If the word ends on s, x, or z an apostophe is attached, and in some cases an apostrophe is inserted before the s.

Norwegian and other agglomerative languages join words. For example a "book reader" is "bokleser". It is not a book, and it is not a reader. Some editors still wants to add a link like [[bok]]leser, but this is more often than not an error. Usually this is done by new users trying to get a "blue" article instead of linking just the important words. Examples of how wrong this can be is someone trying to link "fylkeskommune" like [[fylke]]s[[kommune]] which is very wrong as a "fylkeskommune" is a municipality that has a special role in a county, while the "fylke" ("county") and "kommune" (municipality") describes the individual entities but not the special role. Such linking tries to describe the meaning behind a word by linking its constituents, but usually an agglomerate has some additional hidden meaning.

In short, links using affix rules are "the 90% case". The case whereby someone wants to insert a <nowiki/> to avoid this is very rare. I think most of the present use in nowiki is simply due to this "feature" in VE and is not what the editor intended to do.

Your second paragraph is void, as this bug has nothing to do with where the link goes, it has to do with the link text and what to include in it

It is important to note that the trailing chars not only says what to include but also what not to include in the link text. If the user types something that isn't a trailing char it is likely that the char should not be included in the link text. That is, if the cursor is placed after the link and something is typed that isn't a trailing char, then a space should probably be inserted before the text. This has implications for T128060.

Trying to remember how I myself are using the VE while adding links, I believe I usually add simple links in VE, but as soon as I must add trailing chars I switch to wikitext. That is awkward.

jeblad reopened this task as Open.Mar 13 2016, 6:06 PM

I have reopened this as this is a BUG! Start handling BUGS as they should and don't just make claims that are INVALID!

Jdforrester-WMF changed the task status from Open to Stalled.Mar 14 2016, 2:59 PM

I tend to think that T50463 is close to a show stopper for us.

Then you should comment on that task, and not talk on tasks like this.

(Also, "show stopper" means "nothing can go ahead until this is fixed"; if this is true, can you explain why no-one has mentioned this in the three years since nowiki etc. has had VisualEditor available?)

In short, links using affix rules are "the 90% case". The case whereby someone wants to insert a <nowiki/> to avoid this is very rare. I think most of the present use in nowiki is simply due to this "feature" in VE and is not what the editor intended to do.

Your second paragraph is void, as this bug has nothing to do with where the link goes, it has to do with the link text and what to include in it

It is important to note that the trailing chars not only says what to include but also what not to include in the link text. If the user types something that isn't a trailing char it is likely that the char should not be included in the link text. That is, if the cursor is placed after the link and something is typed that isn't a trailing char, then a space should probably be inserted before the text. This has implications for T128060.

I'm sorry, I don't understand. Can you please re-explain? Everything you write is about the second/third paragraph (T128060), but you're insisting that it's about the first (T50463). I worry that we can spend a lot of effort fixing the task and yet not make you happy, which would be a waste.

[Changing to "Stalled" until you reply; this either is Invalid or should be merged into T128060 or T50463.]

Trying to remember how I myself are using the VE while adding links, I believe I usually add simple links in VE, but as soon as I must add trailing chars I switch to wikitext. That is awkward.

I think but don't know for sure that you are fundamentally mis-understanding how a rich editor works, and it is difficult to help you if we're talking past each other.

Elitre added a subscriber: Elitre.Mar 21 2016, 3:45 PM

Yes, right, … ;/

jeblad removed a subscriber: jeblad.May 12 2016, 8:28 PM

Same problem in CT, as it use VE.

santhosh added a subscriber: santhosh.

Same problem in CT, as it use VE.

No, Content translation(we use CX as abbreviation, not CT - which is for Category Tree) does not use VE yet, it uses native contentedtiable for now.

jhsoby added a subscriber: jhsoby.Oct 15 2016, 9:38 PM
Restricted Application added a subscriber: Danmichaelo. · View Herald TranscriptOct 6 2018, 6:10 AM
cscott added a subscriber: cscott.Oct 9 2018, 4:31 PM