Page MenuHomePhabricator

Allow editors to specify a custom <a> title attribute in wikitext internal links
Open, Needs TriagePublicFeature

Description

Feature summary (what you would like to be able to do and where):
Allow editors to specify a custom <a> title attribute in wikitext internal links. For example using some syntax like [[Foo|title=Bar]] to get some HTML like <a href="/wiki/Foo" title="Bar">Bar</a>.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

  1. Create a page with [[Foo|Bar]].
  2. Check the rendered HTML, the link is something like <a href="/wiki/Foo" title="Foo">Bar</a>
  3. There is no way to change the <a>'s title attribute now.

Benefits (why should this be implemented?):
In a page in Chinese (zh) or other LanguageConverter languages, if there is an over-converted title of single link's target page, editors don't need to add a full page conversion rule if they want to fix the link's title attribute, just like what they would do to fix displayed text of the link ([[title which will be over-converted|displayed text which won't be over-converted]]).

Event Timeline

Hi @PHING, thanks for taking the time to report this and welcome to Wikimedia Phabricator!
What does "over-convert" mean? What is a specific real example for this problem? It remains unclear to me why and when you need to "fix" the title of a link.

By "over-convert" I mean the LanguageConverter gives wrong result because of existing conversion rules. For a specific example, if there is a rule in ZhConversion.php convert "内存" to "記憶體" in zh-tw, and if there is a page titled "体内存在", in a Chinese page, when using zh-tw variant, the page title "体内存在" will not be converted to "體內存在" but to a wrong result "體記憶體在". In this case, [[体内存在]] gives something like <a href="/wiki/体内存在" title="體記憶體在">體記憶體在</a>, and [[体内存在|体内-{}-存在]] gives something like <a href="/wiki/体内存在" title="體記憶體在">體內存在</a>. The second one fixed the over-converted displayed text, but the <a>'s title attribute is still over-converted. In practice, there are no such rules too easy to over-convert, but there will always have very special cases that editors need to fix it individually in the source Wikitext.