Last modified: 2013-09-09 22:30:13 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T35091, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33091 - Parsoid: Linking on a part of a word triggers linktrail
Parsoid: Linking on a part of a word triggers linktrail
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
serializer (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Gabriel Wicke
:
: 41160 44779 (view as bug list)
Depends on:
Blocks: ve-linkediting 39254
  Show dependency treegraph
 
Reported: 2011-12-14 11:31 UTC by Liangent
Modified: 2013-09-09 22:30 UTC (History)
12 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Liangent 2011-12-14 11:31:05 UTC
I want to get:

I want two <a href="/wiki/apple">apple</a>s.

so I input "I want to apples." then add link to "apple" on "apple". It then generates wikitext "I want two [[apple|apple]]s." which is rendered as:

I want two <a href="/wiki/apple">apples</a>.
Comment 1 Daniel Friesen 2011-12-14 17:49:24 UTC
How is this a Visual Editor bug?

If you type [[apple]]s in a normal wiki page the linktrail will make the s part of the link.
Comment 2 Yair Rand 2011-12-14 23:07:40 UTC
The expected wikitext would be [[apple]]<nowiki />s (or something that has the same effect). Alternatively, the VisualEditor should correctly display the entire word as a link when a user tries to link part of a word, as the HTML resulting from such wikitext would ordinarily produce. The bug is the inconsistency between the display and the wikitext.
Comment 3 James Forrester 2012-06-22 18:13:42 UTC
Confirmed that this is still the behaviour in current version of VE.

Expected behaviour? Certainly, shouldn't created [[A|A]]pple - at best, [[A]]<nowiki></nowiki>pple, if we want to suport this.
Comment 4 James Forrester 2012-06-22 22:05:59 UTC
Mass-moving items into VisualEditor product
Comment 5 James Forrester 2012-06-23 01:34:02 UTC
Mass-move out of "General" to "Data Model".
Comment 6 James Forrester 2012-06-25 18:26:41 UTC
Problem is that Parsoid is wrong converting:

  <a foo>foo</a>bar

... into:

  [[foo]]bar 

... rather than

  [[foo]]<nowiki></nowiki>bar

which though ugly is the correct wikitext for this.
Comment 7 Daniel Friesen 2012-06-25 19:25:01 UTC
Except that only takes strict conversion into account, not the whole picture.

We don't use [[foo]]<nowiki/>bar in articles. While it should be possible to do. It should not be something that WYSIWYG users should inadvertently do by accident.

This should probably be handled with two changes:
- For strict conversion <a>foo</a>bar should be converted properly to [[foo]]<nowiki/>bar
- The UI of the visual editor should have a change to the user's interaction with link creation to make it harder to accidentally create things like <a>foo</a>bar.

I'm not quite sure what the ui change should be. Perhaps something like making it so that when you try to create a link the selection might be altered to cover the full word. Something that would require the user to force the editor to use the selection that would create a <nowiki/> instead of just accepting it as-is.

Whatever the case, we do not want the user who partially selects a run of text and turns it into a link to inadvertently create a <nowiki/> when they likely intended to make a link of the whole thing.
Comment 8 James Forrester 2012-06-25 20:02:47 UTC
Agree that we might want to consider adjusting the UI to hinting on this - have added as a see-also.
Comment 9 Liangent 2012-06-25 20:09:33 UTC
(In reply to comment #8)
> Agree that we might want to consider adjusting the UI to hinting on this - have
> added as a see-also.

see also self?
Comment 10 James Forrester 2012-06-25 20:18:33 UTC
Whoops, sorry. Fixed.
Comment 11 James Forrester 2012-08-06 19:25:48 UTC
Mass-moving bugs into the new 'Parsoid' product.
Comment 12 Gabriel Wicke 2012-12-11 02:27:27 UTC
Patch committed in https://gerrit.wikimedia.org/r/#/c/38010/.
Comment 13 Gabriel Wicke 2012-12-21 22:16:40 UTC
Works in tests, but does not yet work correctly in the VE. Needs further investigation.
Comment 14 Gabriel Wicke 2012-12-27 21:33:45 UTC
Patch that fixes escaping with latest JSDOM submitted in https://gerrit.wikimedia.org/r/40974.
Comment 15 Gabriel Wicke 2012-12-27 21:34:56 UTC
And merged.
Comment 16 James Forrester 2013-02-12 21:31:23 UTC
*** Bug 44779 has been marked as a duplicate of this bug. ***
Comment 17 Roan Kattouw 2013-03-22 21:23:30 UTC
Not actually fixed:

$ echo '<a href="Bar" rel="mw:WikiLink">Bar</a>Baz' | node js/tests/parse.js --html2wt
[[Bar]]Baz

$ echo 'Foo<a href="Bar" rel="mw:WikiLink">Bar</a>Baz' | node js/tests/parse.js --html2wt
Foo[[Bar]]Baz

(against current master)
Comment 18 Roan Kattouw 2013-03-22 21:23:47 UTC
*** Bug 41160 has been marked as a duplicate of this bug. ***
Comment 19 Gerrit Notification Bot 2013-05-15 20:39:59 UTC
Related URL: https://gerrit.wikimedia.org/r/63919 (Gerrit Change I627dd609d4eb00080c61628306ad8c3aea7a9077)
Comment 20 Gabriel Wicke 2013-05-16 19:42:59 UTC
The above commit has been merged.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links