Page MenuHomePhabricator

LInks: Add support for self-links
Open, MediumPublic

Description

See https://en.wikipedia.org/wiki/User:Ssastry/VE_Test#Self-link_test and see Parsoid's rendering of the same.

https://meta.wikimedia.org/wiki/Help:Self_link is the documentation.

Causes rendering diffs in https://en.wikipedia.org/wiki/Prairie_Home_Companion -- found via looking at a visual diff.


Version: unspecified
Severity: normal

Details

Reference
bz67486

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:31 AM
bzimport set Reference to bz67486.
ssastry created this task.Jul 3 2014, 6:12 PM

One issue to consider with self-links is that the page name might not be constant. Flow posts for example are displayed in several contexts including timelines. Users might expect the 'self' to follow the actual page URL.

Originally we considered styling self links with CSS (attribute selectors), similar to red links.

Solution using CSS:

<html><style>

    a[href="test.html"] {
        font-weight: bold;
        color: inherit;
        text-decoration: inherit;
        pointer-events: none;
        cursor: text;
    }
</style>
<body>
    Some link to <a href="test.html">test.html</a> 
</body>

</html>

Arlolra set Security to None.

One issue to consider with self-links is that the page name might not be constant. Flow posts for example are displayed in several contexts including timelines. Users might expect the 'self' to follow the actual page URL.

We're consistently rendering against the topic now (except board header, which is rendered against the board).

Originally we considered styling self links with CSS (attribute selectors), similar to red links.

On a single board, topic A might link to itself. Then, topic B might link to topic A. Only the self-link should be bold. Topic B's link to Topic A should appear as a normal link.

Thus, to do it with CSS/LESS we would have to post-process. E.g. convert the above into the following LESS:

#flow-topic-se7l8dzgtdcd1f47 {
    a[href="/wiki/Topic:Se7l8dzgtdcd1f47"] {
        font-weight: bold;
        color: inherit;
        text-decoration: inherit;
        pointer-events: none;
        cursor: text;
    }
}

(the href differs from what Parsoid would give because of other post-processing).

It might end up simpler for Flow to do a DOM transformation (which we already do for other purposes, e.g. red links).

Maybe it should be marked as a self-link with data-mw; not sure.

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 28 2015, 1:38 AM
Restricted Application added a project: Growth-Team. · View Herald TranscriptSep 4 2018, 2:11 PM