Last modified: 2012-08-14 17:35:33 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 T35104, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33104 - Parsoid: Unable to create [[a]]-style link
Parsoid: Unable to create [[a]]-style link
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
serializer (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Gabriel Wicke
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-14 14:39 UTC by Liangent
Modified: 2012-08-14 17:35 UTC (History)
10 users (show)

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


Attachments

Description Liangent 2011-12-14 14:39:59 UTC
If I type "a" and add add a link to [[a]] on it, wikitext generated is [[a|a]]. It looks impossible to create [[a]]. A related bug (or feature request) can be the default link target should be "a", not an empty string.

Maybe we can have two types or links: link to the text itself, if the link is created with a target of empty string, if you edit the string by, eg, inserting some characters in middle, the target changes; another is link to a specified page that does not change no matter how you edit the link text.
Comment 1 Siddhartha Ghai 2012-04-24 03:54:31 UTC
Selecting text, then clicking on the arrow that appears above the selection and choosing the link icon asks for input for the page title, with the default input as a blank string. It should have the selected text prefilled as the title.
Comment 2 James Forrester 2012-06-22 18:26:54 UTC
Confirmed as still a bug in current version.
Comment 3 James Forrester 2012-06-22 22:06:10 UTC
Mass-moving items into VisualEditor product
Comment 4 James Forrester 2012-06-23 01:38:39 UTC
Mass-move out of "General" to "ContentEditable".
Comment 5 Brion Vibber 2012-06-23 02:57:48 UTC
This probably belongs in the data model or serialization, rather than the editing portion.
Comment 6 James Forrester 2012-06-25 18:28:53 UTC
Problem in Parsoid-side serialiser?
Comment 7 ssastry 2012-06-25 20:41:01 UTC
Is the expectation that if link text is identical to target wikipage, the dom is serialized to [[a]] instead of [[a|a]]?
Comment 8 Gabriel Wicke 2012-06-25 20:57:30 UTC
That would be the most compact and canonical way to serialize the link. We'll need support for the conversion of [[a]] to [[a|b]] in the serializer too, which is currently missing. Link tails and pipe tricks complicate things further, so I think there is some fun to be had in tweaking the link handler in the serializer.
Comment 9 Liangent 2012-06-25 21:22:13 UTC
(In reply to comment #7)
> Is the expectation that if link text is identical to target wikipage, the dom
> is serialized to [[a]] instead of [[a|a]]?

I think, if the text can be normalized to target title, then no pipe.

So, use [[page_title]] instead of [[Page title|page_title]].
Comment 10 James Forrester 2012-06-26 02:09:15 UTC
I assume you mean [[page title]] over [[Page_title|page title]]? Obviously this is wiki-dependent (whether $wgCapitalLinks is true or not).

Also, should things like [[X (foo)|]] auto-conversion on save to [[X (foo)|X]] be supported? This won't be used by VisualEditor, but might by something else and if Parsoid is to become feature-compatible...
Comment 11 MZMcBride 2012-06-26 03:07:33 UTC
(In reply to comment #10)
> I assume you mean [[page title]] over [[Page_title|page title]]? Obviously this
> is wiki-dependent (whether $wgCapitalLinks is true or not).

Given that underscores and spaces are identical to MediaWiki, I'm not sure what distinction you're making here.

> Also, should things like [[X (foo)|]] auto-conversion on save to [[X (foo)|X]]
> be supported? This won't be used by VisualEditor, but might by something else
> and if Parsoid is to become feature-compatible...

As far as I'm aware, the current thinking on the pipe trick is that it should ideally not be doing transformations on the wikitext itself and that doing so (the current behavior) is a bug, not a feature. That is, when a user enters "[[Foo (bar)|]]", the current MediaWiki parser will change this to "[[Foo (bar)|Foo]]" on page save and render the result as "Foo". In an ideal world (according to some other bug I don't care to look up), the wikitext would stay "[[Foo (bar)|]]" and would render as "Foo" (as though it had gone through the magical transformation).

That said, the pipe trick is annoying (and somewhat expensive) to support and given that the broader goal is to move away from wikitext altogether, I'm not sure the pipe trick is something worth preserving going forward. But this is all outside the scope of this bug.
Comment 12 James Forrester 2012-06-26 03:21:51 UTC
The (In reply to comment #11)
> (In reply to comment #10)
> > I assume you mean [[page title]] over [[Page_title|page title]]? Obviously this
> > is wiki-dependent (whether $wgCapitalLinks is true or not).
> 
> Given that underscores and spaces are identical to MediaWiki, I'm not sure what
> distinction you're making here.

The design brief for the VisualEditor/Parsoid combo is to be as close as possible to the same as real human wikitext - which means, amongst other things, writing links like a human would (and never ever changing one written by an actual human).

> > Also, should things like [[X (foo)|]] auto-conversion on save to [[X (foo)|X]]
> > be supported? This won't be used by VisualEditor, but might by something else
> > and if Parsoid is to become feature-compatible...
> 
> As far as I'm aware, the current thinking on the pipe trick is that it should
> ideally not be doing transformations on the wikitext itself and that doing so
> (the current behavior) is a bug, not a feature. That is, when a user enters
> "[[Foo (bar)|]]", the current MediaWiki parser will change this to "[[Foo
> (bar)|Foo]]" on page save and render the result as "Foo".


Thinking by whom? It's a widely-used long-term feature. If people believe they can switch it off as a 'bug fix', I predict that users will be unhappy. Burning our social capital like this seems... ill-prioritised.

> In an ideal world
> (according to some other bug I don't care to look up), the wikitext would stay
> "[[Foo (bar)|]]" and would render as "Foo" (as though it had gone through the
> magical transformation).

Didn't come up in a search for me, unless I mis-read the results. Would value the actual bug ref. if you can find it! :-)

> That said, the pipe trick is annoying (and somewhat expensive) to support and
> given that the broader goal is to move away from wikitext altogether, I'm not
> sure the pipe trick is something worth preserving going forward. But this is
> all outside the scope of this bug.

I'd argue that it's not outwith the scope of a bug in the Parsoid talking about this behaviour, which is what this is. :-)
Comment 13 MZMcBride 2012-06-26 03:48:52 UTC
(In reply to comment #12)
>> As far as I'm aware, the current thinking on the pipe trick is that it should
>> ideally not be doing transformations on the wikitext itself and that doing so
>> (the current behavior) is a bug, not a feature. That is, when a user enters
>> "[[Foo (bar)|]]", the current MediaWiki parser will change this to "[[Foo
>> (bar)|Foo]]" on page save and render the result as "Foo".
> 
> Thinking by whom? It's a widely-used long-term feature. If people believe they
> can switch it off as a 'bug fix', I predict that users will be unhappy. Burning
> our social capital like this seems... ill-prioritised.

I think there are some mixed signals about design goals here. I was told (repeatedly) that the goal of VisualEditor was to eliminate human interaction with wikitext. If that's the goal (and you're rewriting the parser), I'm not sure why (given the extra, non-negligible cost of supporting it) you'd continue to support the pipe trick. It's an esoteric, poorly implemented hack, as far as I'm concerned.

The referenced thinking is by me and others; this isn't a new issue. And it really does seem completely outside the scope of this bug. I expand on both these points below.

>> In an ideal world
>> (according to some other bug I don't care to look up), the wikitext would stay
>> "[[Foo (bar)|]]" and would render as "Foo" (as though it had gone through the
>> magical transformation).
> 
> Didn't come up in a search for me, unless I mis-read the results. Would value
> the actual bug ref. if you can find it! :-)

It's hiding under bug 5004 ("Keep the pipe trick ([[Piped link|]]) syntax in wikitext instead of converting it at pre-save transform"). I thought there was a comment from Aryeh somewhere about this as well, but I don't see it on that bug. There are a number of related bugs: bug 16714 and bug 2700. And some marginally related bugs (e.g., bug 845). These were all found by searching Bugzilla for "pipe trick", creatively.

>> That said, the pipe trick is annoying (and somewhat expensive) to support and
>> given that the broader goal is to move away from wikitext altogether, I'm not
>> sure the pipe trick is something worth preserving going forward. But this is
>> all outside the scope of this bug.
> 
> I'd argue that it's not outwith the scope of a bug in the Parsoid talking about
> this behaviour, which is what this is. :-)

This bug is (or was...) about [[a]] being turned into [[a|a]] when using the VisualEditor interface (cf. comment 0). Link trails and pipe tricks (and any other parser craziness) really are separate bugs.
Comment 14 James Forrester 2012-08-06 19:25:55 UTC
Mass-moving bugs into the new 'Parsoid' product.
Comment 15 Mark Holmquist 2012-08-06 22:49:15 UTC
https://gerrit.wikimedia.org/r/17917

Done. Thanks to Gabriel for the over-shoulder glances.
Comment 16 Gabriel Wicke 2012-08-06 22:52:53 UTC
Verified as fixed.

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


Navigation
Links