Last modified: 2014-04-15 20:03:23 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 T55505, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 53505 - VisualEditor: Provide a way for users to edit auto-numbered external links
VisualEditor: Provide a way for users to edit auto-numbered external links
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
Editing Tools (Other open bugs)
unspecified
All All
: Low enhancement
: VE-deploy-2013-12-05
Assigned To: Roan Kattouw
:
: 57419 57755 (view as bug list)
Depends on: 53432
Blocks: 51245
  Show dependency treegraph
 
Reported: 2013-08-28 22:29 UTC by Gabriel Wicke
Modified: 2014-04-15 20:03 UTC (History)
7 users (show)

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


Attachments

Description Gabriel Wicke 2013-08-28 22:29:31 UTC
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?
Comment 1 Gabriel Wicke 2013-08-29 21:29:24 UTC
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.
Comment 2 Gabriel Wicke 2013-08-29 21:32:07 UTC
See http://www.w3.org/TR/css3-content/ for the relevant spec.
Comment 3 Gabriel Wicke 2013-08-29 21:55:50 UTC
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.
Comment 4 James Forrester 2013-08-29 22:08:51 UTC
(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. :-)
Comment 5 Gabriel Wicke 2013-08-29 22:21:14 UTC
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.
Comment 6 James Forrester 2013-08-29 22:44:46 UTC
(In reply to comment #5)
> Please test this test with IE as well. I am hopeful that it works with IE >=
> 8.

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

In IE10 and IE11 you get all five links as expected.
Comment 7 Krinkle 2013-08-29 22:51:41 UTC
* Supports:
  - http://caniuse.com/#feat=css-sel3 (CSS3 :empty)
  - http://caniuse.com/#feat=css-counters (counter-increment)
  - http://caniuse.com/#feat=css-gencontent (:before)

* Test case: http://jsfiddle.net/wTNc4/
  - Works fine in IE9: http://cl.ly/image/2r2L1F3U2X0r

I wonder why it didn't work for James?
Comment 8 Gabriel Wicke 2013-08-29 22:53:26 UTC
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.
Comment 9 Gerrit Notification Bot 2013-10-17 20:54:36 UTC
Change 90432 had a related patch set uploaded by Catrope:
Add a node type for numbered external links

https://gerrit.wikimedia.org/r/90432
Comment 10 Gerrit Notification Bot 2013-10-21 11:00:56 UTC
Change 90432 merged by jenkins-bot:
Add a node type for numbered external links

https://gerrit.wikimedia.org/r/90432
Comment 11 James Forrester 2013-10-21 15:17:22 UTC
Though the code in Gerrit change #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.
Comment 12 James Forrester 2013-11-26 18:04:20 UTC
*** Bug 57419 has been marked as a duplicate of this bug. ***
Comment 13 Gerrit Notification Bot 2013-11-28 18:09:40 UTC
Change 98114 had a related patch set uploaded by Catrope:
Make autonumbered external links inspectable

https://gerrit.wikimedia.org/r/98114
Comment 14 Gerrit Notification Bot 2013-11-30 08:58:11 UTC
Change 98114 merged by jenkins-bot:
Make autonumbered external links inspectable

https://gerrit.wikimedia.org/r/98114
Comment 15 Elitre 2013-12-02 16:12:50 UTC
*** Bug 57755 has been marked as a duplicate of this bug. ***

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


Navigation
Links