When you add a link with TMCE to a TWiki topic the path gets wrong. It links to the Edit script.
It should not even attempt to include any URL when you just give a topic name
To reproduce write the name of a TWiki page like Item4534
Mark the
Item4534 and hit link button and in the link URL just write Item4534.
The result is a URL pointing to editing the topic.
--
TWiki:Main/KennethLavrsen
- 02 Sep 2007
Let us try something more. A link in another web
TWiki.TextFormattingRules
And a real link to a URL
Lavrsen
--
TWiki:Main.KennethLavrsen
- 02 Sep 2007
The web dot topic goes completely wrong
A real URL works.
I intuitively expect the tool to put the link text I write in a [[left side of square bracket][and marked text on the right side]] and not trying to invent something itself
--
TWiki:Main.KennethLavrsen
- 02 Sep 2007
The path rewriting in
TinyMCE is gormless. Duplicate of
Item4534
CC
They are not the same bug and there is a danger that one is fixed and not the other.
I prefer keeping bugs that are similar but not same open so I can regression test when they finally do get closed. Otherwise I will have fogotten.
Besides - it is important that TMCE does not try to be intelligent at all when you add a link.
The editor must put anything you write as link on the [<nop>[left side of bracket][link text]].
I do not want Item4534 to be interpreted to a URL. If we suddenly change URL to our webserver or I move the TWiki I do not want to end up with absolute URLs to the server itself all over the place. That is a show stopper of dimensions. I am constantly monitoring our TWiki and alter absolute internal URLs to avoid this nightmare scenario. The link feature should not try to be smart. Just put whatever people put in the URL box in the left side of a square bracket box.
KJL
I had to do quite a lot of work to fix this and
Item4534. TinyMCE wants to control your links to a considerable degree, and I had to explain to it about TWiki links. So you can use TWiki words in the link add dialog, and you can add simple attachment names in the image dialog.
CC
No it is still too smart. It should not alter what you enter as link text. It is silly to end up with [[%SCRIPTURL{"view"}%//MyTopic][This nice link]] when you really just want [[MyTopic][This nice link]]
Please. No intelligence at all. Reopening.
KJL
I have observed that if I add the link as
Webname.TopicName
the bracket left side gets correct. If I add only a
TopicName
the SCRIPTURL thing gets added.
--
TWiki:Main.KennethLavrsen
- 04 Sep 2007
Actually it's not as simple as that. In order for links to appear in
TinyMCE as links, it automatically rewrites links to full urls. If I don't override that behaviour and handle
WikiWords specially, it rewrites them to the edit links we saw before. When I rewrite the links I have to give a ful absolute URL. Fortunately
WysiwygPlugin pattern-matches those URLs, and converts them
back into wikiwords. There is no way around this; it is integral to the way
TinyMCE works.
However, there is something wrong with the rewriting on this site which is causing the rewriting of a wikiword URL to fail. I suspect the ~
Investigating
CC
As suspected it was the
URL rewriting.
CC
Maybe that was also a problem
But the links are still wrong. I only test on my own server and I do not have URL rewriting or funny characters in the URL.
And now the links are totally screwed up.
I made a line with two links. First with web dot topic and then topic only
First one has a completely non functioning link to attachdir. And the 2nd still has that SCRIPTURL and the web name is missing so it does not even work as a valid link
First a [[%ATTACHURL%/Myweb.TocTest][web dot topic link]] and then a [[%SCRIPTURL{"view"}%//TocTest][topic only URL]] now let us see.
How did you test this before you checked it in? Did you test in IE? Reopening this for the 3rd time.
--
TWiki:Main.KennethLavrsen
- 04 Sep 2007
Kenneth, please bear in mind that we may not be talking about the same thing. It's critical that I know
exactly how you added those links. It is unclear from the above. Did you type them in as plain text into
TinyMCE? Did you select some text and use the link toolbar button? If the latter, what did you type into the URL box?
CC
It is straight forward simple easy to reproduce.
- I write some text
- I select a word or two
- I move the mouse up and click the link button
- A menu opens
- I enter a topic name
- In one case the Webname.TopicName
- In the other case just a TopicName
- I save
- And I look at the raw view to see what was saved.
I just tried again (on my own indstallation because here on bugs the TMCE is disabled almost everywhere.
The result is pasted in below.
And first a [[Sandbox.TestTopic1][link in sandbox]] and then [[%SCRIPTURL{"view"}%//CopyPasteTest][a local]] link
This time the Web dot Topic worked. The local link did not.
BUT REMEMBER TO TEST IN INTERNET EXPLORER
I just tried in Firefox and there it worked.
It seems to only fail in Internet Explorer. I do 95% of tests in IE.
Note that I did not copy paste anything. I typed it all on the keyboard.
KJL
Crikey, it took a while to track that one down!
It's due to IE adding an extra / in URL's for no particular reason that I can see.
CC
CC
Reopening.
As I entered
Item4605 (Firefox) the link was goofed again.
I selected the Item number.
I clicked the link icon.
I entered the Item topicname.
Saved.
And the link is some pub link.
It is still too intelligent. Why can't square bracket links be totally unintelligent?
I think it is the 5th time I reopen this bug item. Last time it was closed without a checkin registered. Why?
KJL
Same happened now here.
See the Item4605 link above. It is wrong. This was in Firefox.
You need to test these combinations.
|
Web.Topic |
Topic |
!Web.WikiWord |
!WikiWord |
IE |
|
|
|
|
FF |
|
|
|
|
--
TWiki:Main.KennethLavrsen
- 10 Sep 2007
Trying IE6
Item4605 link
Also broken in IE. So the bug is back. In a new shape.
--
TWiki:Main.KennethLavrsen
- 11 Sep 2007
You ask "Why" above. The answer is "you are testing different things each time you try it".
It's pretty obvious what the problem is from what you write above. You didn't actually enter a valid
WikiWord for the link, so TMCE assumed you were trying to create a link to a file on disc somewhere. "Item4506" is not a wikiword, so it's hard for it to deduce you were trying to link to a topic.
Why can't square bracket links be unintellligent? Don't go there. There are two levels of misinterpretation of links - the browser, and then tinymce - before I ever get my mucky hands on the link text. If it was as simple as "just entering the text the user types" I would obviously do just that. There is a fair amount of code in there dedicated to trying to untangle what is done to links so that the result
looks as if nothing was done
I will see if it's possible to relax the rules on topic linking even further.
CC
BTW you missed subweb support in your testcases above.
I relaxed the rules right the way down so that non-wikiword topic names are now allowed. It should be more resistant to your attempts to break it.
CC
Opening this AGAIN.
I am getting tired of this now. It is the 7th time you say you have fixed it and that I reopen it because it does not work.
This is the result of trying all the combinations in FF
jeg vil [[%ATTACHURL%/TestTopic1][gerne]] teste [[%ATTACHURL%/Sandbox.TestTopic1][dette]] med [[%ATTACHURL%/Myweb.Mysub.TestTopic1][nogle]] almindelige [[%ATTACHURL%/Testtopic][ord]] som ikke [[%ATTACHURL%/Sandbox.Testtopic][siger]] noget [[%ATTACHURL%/Myweb.Mysub.Testtopic][some]] helst men bare er der <br />
And here is the result from IE
<P>Jeg vil <A class="" href="http://merlin.lavrsen.dk/twiki/pub/Myweb/LinkingTest/TestTopic1" mce_href="http://merlin.lavrsen.dk/twiki/pub/Myweb/LinkingTest/TestTopic1">gerne</A> teste <A class="" href="http://merlin.lavrsen.dk/twiki/pub/Myweb/LinkingTest/Sandbox.TestTopic1" mce_href="http://merlin.lavrsen.dk/twiki/pub/Myweb/LinkingTest/Sandbox.TestTopic1">dette</A> med <A class="" href="http://merlin.lavrsen.dk/twiki/pub/Myweb/LinkingTest/Myweb.Mysub.TestTopic1" mce_href="http://merlin.lavrsen.dk/twiki/pub/Myweb/LinkingTest/Myweb.Mysub.TestTopic1">nogle</A> almindelige <A class="" href="http://merlin.lavrsen.dk/twiki/pub/Myweb/LinkingTest/Testtopic1" mce_href="http://merlin.lavrsen.dk/twiki/pub/Myweb/LinkingTest/Testtopic1">ord</A> some ikke <A class="" href="http://merlin.lavrsen.dk/twiki/pub/Myweb/LinkingTest/Sandbox.Testtopic" mce_href="http://merlin.lavrsen.dk/twiki/pub/Myweb/LinkingTest/Sandbox.Testtopic">siger</A> noget <A class="" href="http://merlin.lavrsen.dk/twiki/pub/Myweb/LinkingTest/Myweb.Mysub.Testtopic" mce_href="http://merlin.lavrsen.dk/twiki/pub/Myweb/LinkingTest/Myweb.Mysub.Testtopic">som</A> helst men bare er der<BR></P>
And this is actually just the part I created. The rest of the topic is totally goofed up.
--
TWiki:Main.KennethLavrsen
- 12 Sep 2007
OK, once again:
Item4500
TWikiPreferences
Bugs.Item4500
In order to try and be more inclusive of UTF-8 users I relaxed the rules that match a wikiname. Clearly it didn't work. It does now.
CC
Reopening. Still problems with subweb type links but close to working this time. Actually functionally it is OK but I see a rick things can break. Small difference in IE and FF this time. And same behavior with wikiword and non wikiword topic names.
When I enter the text in the popup I enter:
Myweb.Subweb.Topicname
Ie dot syntax which is the normal syntax for subwebs.
Result with IE
afda [[TestTopic1][fsaf]] safasd [[Sandbox.TestTopic1][fsa]] fdas fas f [[Myweb/Mysub/.TestTopic1][saf]] asf a fg [[Testtopic1][sfdgds]] gfsgsfsd g [[Sandbox.Testtopic1][dsg]] g sdg gh [[Myweb/Mysub/.Testtopic1][gd]] gd gdfdhd
Result with FF
hjfhdjfsfs [[TestTopic1][sdfsaf]] saf [[Sandbox.TestTopic1][asf ]]asf dsa [[Myweb/Mysub.TestTopic1][fdas]] fd fsa f asf [[Testtopic1][adsaf]] gfd [[Sandbox.Testtopic1][gds]] gfds [[Myweb/Mysub.Testtopic1][gsd]] g sdfg dsg dsgsd gds
I find it risky that the IE subweb case has a /. (slash dot). It should only be a dot.
I have no problem with the / between web and subweb. In fact I will change the docs I did on subweb syntax to use / instead so it is consistant with what we show elsewhere.
Seems like you still need to fight a little with IE and its dammed /'es
We also had a problem with this with attachment names a year ago I remember.
Small detail this time
--
TWiki:Main.KennethLavrsen
- 14 Sep 2007
Should be OK now.
CC