Ticket #2223 (closed Bug: fixed)

Opened 6 years ago

Last modified 6 years ago

Unnecessary link piping

Reported by: Joe Beaudoin Jr. Owned by:
Priority: Normal Milestone:
Component: Project : MediaWiki+FCKeditor Version: SVN (FCKeditor) - Retired
Keywords: fixed Cc:

Description

When defining links, every single link is piped, regardless of whether it is necessary or not.

For instance

[[William Adama]]

turns into

[[William Adama|William Adama]]

It is a mild irritation for those who like clean code (wiki or otherwise), since piping is unnecessary in the above case.

Attachments

2223.patch (2.9 KB) - added by arczi 6 years ago.
2223_2.patch (4.0 KB) - added by arczi 6 years ago.
2223_3.patch (2.2 KB) - added by arczi 6 years ago.
2223_4.patch (3.1 KB) - added by arczi 6 years ago.
2223_5.patch (9.3 KB) - added by arczi 6 years ago.
2223_5.2.patch (10.5 KB) - added by arczi 6 years ago.
list.txt (1.5 KB) - added by arczi 6 years ago.
2223_6.patch (11.2 KB) - added by arczi 6 years ago.
2223_7.patch (11.3 KB) - added by arczi 6 years ago.

Change History

comment:1 Changed 6 years ago by w.olchawa

  • Keywords Confirmed added; over link piping, pipe, link syntax removed
  • Version set to SVN

Changed 6 years ago by arczi

comment:2 Changed 6 years ago by arczi

  • Keywords Review? added

comment:3 Changed 6 years ago by wwalc

  • Keywords Review+ added; Review? removed

I can't find any issues with it. Go ahead committing it.

Changed 6 years ago by arczi

comment:4 Changed 6 years ago by arczi

  • Keywords Review? added; Review+ removed

It didn't work with link dialog. Repaired in 2223_2.patch

comment:5 Changed 6 years ago by wwalc

  • Keywords Review+ added; Review? removed

comment:6 Changed 6 years ago by arczi

  • Status changed from new to closed
  • Keywords fixed added; Confirmed Review+ removed
  • Resolution set to fixed

Fixed with 2394

comment:7 Changed 6 years ago by wwalc

  • Keywords fixed removed

Fixed with [2394].

comment:8 Changed 6 years ago by wwalc

  • Status changed from closed to reopened
  • Resolution fixed deleted

Ooops, it still doesn't work with links that contain underscore:

[[Foo_Bar]]

is changed into:

[[Foo Bar|Foo_Bar]]

Changed 6 years ago by arczi

comment:9 Changed 6 years ago by arczi

  • Keywords Review? added

comment:10 Changed 6 years ago by wwalc

  • Keywords Review- added; Review? removed

Unfortunately I have found another example that still doesn't work:

[[Help:Link#Subpage feature]]

is changed into

[[Help:Link#Subpage feature#Subpage feature|Help:Link#Subpage feature]]

Changed 6 years ago by arczi

comment:11 Changed 6 years ago by arczi

  • Keywords Review? added; Review- removed

comment:12 Changed 6 years ago by wwalc

  • Keywords Review- added; Review? removed

It looks like [2394] completely broken parsing tags inside of [[ ]] (!).

When using revision 2388, Images are displayed properly when switching to wikitext and back:

[[Image:Test.gif]]

when using current revision, they're changed into links.

This definitely has something to do with adding RTENOTITLE straight after [[ which changes everything into a link.

Changed 6 years ago by arczi

comment:13 Changed 6 years ago by arczi

  • Keywords Review? added; Review- removed

comment:14 Changed 6 years ago by wwalc

  • Keywords Review- added; Review? removed

Looks very good. I didn't check it deeply, but when checking random articles from MediaWiki I managed to find just two more issues:

[[Official position]]s

is changed into:

[[Official position|RTENOTITLEs]]

Links to categories now are broken:

[[Category:Help]]

changes into:

[[Category:Help|RTENOTITLE]]

I haven't checked it, but it seems that this code either removes the following feature, or moves it into other place, could you explain it? It looks like it:

  • removes fix for #2075 in FCKeditorParser.body.php
  • removes fix for #2483 in FCKeditorSkin.body.php (RTECOLON)

Changed 6 years ago by arczi

comment:15 Changed 6 years ago by arczi

  • Keywords Review? added; Review- removed

I need to change RTECOLON to ':' before creating A tag so there is no point in doing it one more time.

makeSelfLinkObj is changed so line

$text = preg_replace("/<strong class=\"selflink\">(.*?)<\/strong>/", 
"<a href=\"".$this->mTitle->mDbkeyform."\" class=\"selflink\">$1</a>", $text);

is now useless, of course selflinks still work.

I attached a list of expressions.

Changed 6 years ago by arczi

comment:16 Changed 6 years ago by wwalc

  • Keywords Review- added; Review? removed

Review-, FCKeditor should at least leave those links functional (below are examples of known and unkown links):

[[Main_Page#Limitations_and_workarounds]]
[[Main_Page#Limitations_and_workarounds|Limitations_and_workarounds]]
[[Main_Page#Limitations_and_workarounds|Limitations and workarounds]]
[[Main_Page#Limitations_and_workarounds|Main_Page#Limitations_and_workarounds]]
[[Main_Page#Limitations_and_workarounds|Main_Page#Limitations and workarounds]]
[[Main_Page#Limitations_and_workarounds|Limitations]]

[[Main_Pag#Limitations_and_workarounds]]
[[Main_Pag#Limitations_and_workarounds|Limitations_and_workarounds]]
[[Main_Pag#Limitations_and_workarounds|Limitations and workarounds]]
[[Main_Pag#Limitations_and_workarounds|Main_Pag#Limitations_and_workarounds]]
[[Main_Pag#Limitations_and_workarounds|Main_Pag#Limitations and workarounds]]
[[Main_Pag#Limitations_and_workarounds|Limitations]]

Another issue I found is that in makeSelfLinkObj() $args is not initialized.

Changed 6 years ago by arczi

comment:17 Changed 6 years ago by arczi

  • Keywords Review? added; Review- removed

comment:18 Changed 6 years ago by wwalc

  • Keywords Review+ added; Review? removed

Ok, let's give it a try.

Please remove this code from makeBrokenLinkObj():

//[[Main page]] -> [[Main_page]]
$u = str_replace($nt->getText(), $nt->getDBkey(), $u);

(let's keep the more user friendly names for links).

comment:19 Changed 6 years ago by wwalc

  • Keywords Review- added; Review+ removed

Ooops unfortunately I have to change my opinion.

[[[[wikipedia:]]]]

is changed into

[[[[:wikipedia:|http://en.wikipedia.org/wiki/]]]]

all other things seems to work fine.

Example taken from http://meta.wikimedia.org/wiki/Help:Interwiki_linking .

Changed 6 years ago by arczi

comment:20 Changed 6 years ago by arczi

  • Keywords Review? added; Review- removed

comment:21 Changed 6 years ago by wwalc

  • Keywords Review+ added; Review? removed

Review+, I found at least one minor bug which has left, but it I believe this patch can be comitted already and we can fix those minor bugs in new tickets. This way it will be easier to track if we break something else while fixing those less important bugs.

comment:22 Changed 6 years ago by arczi

  • Keywords fixed added; Review+ removed
  • Status changed from reopened to closed
  • Resolution set to fixed

Fixed with [2466]

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy