Ticket #2223 (closed Bug: fixed)

Opened 13 months ago

Last modified 10 months ago

Unnecessary link piping

Reported by: Joe Beaudoin Jr. Owned by:
Priority: Normal Milestone:
Component: Project : MediaWiki+FCKeditor Version: SVN (FCKeditor)
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 10 months ago.
2223_2.patch (4.0 KB) - added by arczi 10 months ago.
2223_3.patch (2.2 KB) - added by arczi 10 months ago.
2223_4.patch (3.1 KB) - added by arczi 10 months ago.
2223_5.patch (9.3 KB) - added by arczi 10 months ago.
2223_5.2.patch (10.5 KB) - added by arczi 10 months ago.
list.txt (1.5 KB) - added by arczi 10 months ago.
2223_6.patch (11.2 KB) - added by arczi 10 months ago.
2223_7.patch (11.3 KB) - added by arczi 10 months ago.

Change History

Changed 13 months ago by w.olchawa

  • keywords Confirmed added; over link piping, pipe, link syntax removed
  • version set to SVN

Changed 10 months ago by arczi

Changed 10 months ago by arczi

  • keywords Review? added

Changed 10 months ago by wwalc

  • keywords Review+ added; Review? removed

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

Changed 10 months ago by arczi

Changed 10 months ago by arczi

  • keywords Review? added; Review+ removed

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

Changed 10 months ago by wwalc

  • keywords Review+ added; Review? removed

Changed 10 months ago by arczi

  • keywords fixed added; Confirmed Review+ removed
  • status changed from new to closed
  • resolution set to fixed

Fixed with 2394

Changed 10 months ago by wwalc

  • keywords fixed removed

Fixed with [2394].

Changed 10 months 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 10 months ago by arczi

Changed 10 months ago by arczi

  • keywords Review? added

Changed 10 months 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 10 months ago by arczi

Changed 10 months ago by arczi

  • keywords Review? added; Review- removed

Changed 10 months 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 10 months ago by arczi

Changed 10 months ago by arczi

  • keywords Review? added; Review- removed

Changed 10 months 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 10 months ago by arczi

Changed 10 months 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 10 months ago by arczi

Changed 10 months 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 10 months ago by arczi

Changed 10 months ago by arczi

  • keywords Review? added; Review- removed

Changed 10 months 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).

Changed 10 months 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 10 months ago by arczi

Changed 10 months ago by arczi

  • keywords Review? added; Review- removed

Changed 10 months 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.

Changed 10 months 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.