VisualEditor: Provide a way for users to edit auto-numbered external links
Closed, ResolvedPublic

Description

The Parsoid team is considering a simplification of the different mw:ExtLink/* variants to just a single mw:ExtLink type.

For most types this should not make much of a difference to VE, but for auto-numbered external links ([http://example.com]) it might, so I am looking for your input. I did some testing on https://www.mediawiki.org/wiki/User:GWicke/TestNumberedLinks. Changes to the text lead to corruption as in this diff:

https://www.mediawiki.org/w/index.php?title=User%3AGWicke%2FTestNumberedLinks&diff=772988&oldid=772987

There also does not seem to be any automatic re-numbering when a numbered link is changed into a plain external link.

What are you plans for the handling of numbered links?


Version: unspecified
Severity: enhancement

bzimport set Reference to bz53505.
GWicke created this task.Via LegacyAug 28 2013, 10:29 PM
GWicke added a comment.Via ConduitAug 29 2013, 9:29 PM

Maybe this could even be handled in CSS, somewhat like this example:

<html><head>
<style>
body {

color: red;
counter-reset: numberedlink;

}
a[typeof~="mw:ExtLink"]:empty:before {

content: "[" counter(numberedlink) "]";
counter-increment: numberedlink;

}
</style>
</head>
<body>
<a typeof="mw:ExtLink"></a>
<a typeof="mw:ExtLink"></a>
<a typeof="mw:ExtLink"></a>
<a typeof="mw:ExtLink"></a>
</body>
</html>

Problems in this simple experiment:

  • Links are not clickable, and (maybe related)
  • the content can only be generated :before and :after, but not inside the empty link.
GWicke added a comment.Via ConduitAug 29 2013, 9:32 PM

See http://www.w3.org/TR/css3-content/ for the relevant spec.

GWicke added a comment.Via ConduitAug 29 2013, 9:55 PM

With a href set this actually works as expected in FF and Chrome:

<html><head>
<style>
body {

counter-reset: numberedlink;

}
a[typeof~="mw:ExtLink"]:empty:after {

content: "[" counter(numberedlink) "]";
counter-increment: numberedlink;

}
</style>
</head>
<body>
<a href="test" typeof="mw:ExtLink"></a>
<a href="test" typeof="mw:ExtLink">not empty</a>
<a href="test" typeof="mw:ExtLink"></a>
<a href="test" typeof="mw:ExtLink"></a>
<a href="test" typeof="mw:ExtLink"></a>
</body>
</html>

So it seems that we can actually implement auto-numbered links in pure CSS.

Jdforrester-WMF added a comment.Via ConduitAug 29 2013, 10:08 PM

(In reply to comment #3)

With a href set this actually works as expected in FF and Chrome:

[…]

So it seems that we can actually implement auto-numbered links in pure CSS.

That's great. :-)

We will still need a way of creating an auto-numbered external link (rather than just being able to copy and alter them), but that's our problem. :-)

GWicke added a comment.Via ConduitAug 29 2013, 10:21 PM

Yeah, you need the UI for the creation of empty links. But there is no need to deal with renumbering etc in VE, which simplifies things a lot.

Please test this test with IE as well. I am hopeful that it works with IE >= 8.

Jdforrester-WMF added a comment.Via ConduitAug 29 2013, 10:44 PM

(In reply to comment #5)

Please test this test with IE as well. I am hopeful that it works with IE >=

In IE9 you get "not empty" but none of the other four links.

In IE10 and IE11 you get all five links as expected.

Krinkle added a comment.Via ConduitAug 29 2013, 10:51 PM

I wonder why it didn't work for James?

GWicke added a comment.Via ConduitAug 29 2013, 10:53 PM

I guess that means that we can go ahead and drop the explicit numbering in Parsoid in favor of pure CSS. We will also drop the /Numbered typeof suffix along with the other mw:ExtLink suffixes.

You will then get empty links with typeof="mw:ExtLink" as in this example.

gerritbot added a comment.Via ConduitOct 17 2013, 8:54 PM

Change 90432 had a related patch set uploaded by Catrope:
Add a node type for numbered external links

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

gerritbot added a comment.Via ConduitOct 21 2013, 11:00 AM

Change 90432 merged by jenkins-bot:
Add a node type for numbered external links

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

Jdforrester-WMF added a comment.Via ConduitOct 21 2013, 3:17 PM

Though the code in gerrit 90432 is merged, that just adjusts how VisualEditor works with auto-numbered links to support Parsoid's changed behaviour - this bug remains undone. Resetting to ASSIGNED.

Jdforrester-WMF added a comment.Via ConduitNov 26 2013, 6:04 PM
  • Bug 57419 has been marked as a duplicate of this bug. ***
gerritbot added a comment.Via ConduitNov 28 2013, 6:09 PM

Change 98114 had a related patch set uploaded by Catrope:
Make autonumbered external links inspectable

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

gerritbot added a comment.Via ConduitNov 30 2013, 8:58 AM

Change 98114 merged by jenkins-bot:
Make autonumbered external links inspectable

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

Elitre added a comment.Via ConduitDec 2 2013, 4:12 PM
  • Bug 57755 has been marked as a duplicate of this bug. ***

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.