Ticket #2223 (closed Bug: fixed)
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
Change History
comment:1 Changed 5 years ago by w.olchawa
- Keywords Confirmed added; over link piping, pipe, link syntax removed
- Version set to SVN
comment:3 Changed 5 years ago by wwalc
- Keywords Review+ added; Review? removed
I can't find any issues with it. Go ahead committing it.
comment:4 Changed 5 years ago by arczi
- Keywords Review? added; Review+ removed
It didn't work with link dialog. Repaired in 2223_2.patch
comment:6 Changed 5 years ago by arczi
- Status changed from new to closed
- Keywords fixed added; Confirmed Review+ removed
- Resolution set to fixed
Fixed with 2394
comment:8 Changed 5 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]]
comment:10 Changed 5 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]]
comment:12 Changed 5 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.
comment:14 Changed 5 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:
comment:15 Changed 5 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.
comment:16 Changed 5 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.
comment:18 Changed 5 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 5 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 .
comment:21 Changed 5 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 5 years ago by arczi
- Keywords fixed added; Review+ removed
- Status changed from reopened to closed
- Resolution set to fixed
Fixed with [2466]
