joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

Article editor - cannot link to an anchor on start page

Open o-joomla-issues opened this issue 1 year ago • 11 comments

Steps to reproduce the issue

Edit article Add link per link icon with target like /#my-startpage-anchor

Expected result

<p>Some link to an <a href="/#my-startpage-anchor">anchor</a></p>

Actual result

<p>Some link to an <a href="#my-startpage-anchor">anchor</a></p> ⇨ Leading slash removed, link will not work on any sub-page/url

System information

Joomla! ‎5.1.0 PHP 8.3.4 as fpm-fcgi on nginx

Additional comment

Trailing slash also gets removed when adding link manually in html source code w/ tyinmce editor turned off.

o-joomla-issues avatar Apr 22 '24 21:04 o-joomla-issues

Same as #43324 ? Or only similar?

richard67 avatar Apr 22 '24 21:04 richard67

@richard67 different issue

brianteeman avatar Apr 22 '24 21:04 brianteeman

Is this something that used to work? There have been quite a few changes in 5.1 which may have created this https://github.com/joomla/joomla-cms/pulls?q=is%3Apr+trailing+slash+is%3Amerged

brianteeman avatar Apr 22 '24 21:04 brianteeman

Just checked, same problem in Joomla 3.10.12


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43332.

o-joomla-issues avatar Apr 23 '24 09:04 o-joomla-issues

@o-joomla-issues I cannot replicate your problem with tinyMCE. j 5.1.0,

I write your link in html-mode, save and the result is

<p>Some link to an <a href="../#my-startpage-anchor">anchor</a></p>

chmst avatar Apr 24 '24 08:04 chmst

Where does the .. come from? .. is different from / and might not lead to the start page.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43332.

o-joomla-issues avatar Apr 24 '24 08:04 o-joomla-issues

I used tinyMCE entered your code into an article and saved. This was the result after saving the article therefore comes from tinyMCE.

chmst avatar Apr 24 '24 19:04 chmst

That's odd. With all Joomla versions I manage, it never adds dots. Maybe we have different settings for URL rewrite. But either - removing leading slash or adding dots - is an issue as it breaks links. TincMCE should not change links in any way.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43332.

o-joomla-issues avatar Apr 25 '24 06:04 o-joomla-issues

Have you tried setting tinymce to use absolute instead of relative urls?

image

brianteeman avatar Aug 19 '24 17:08 brianteeman

Closing due to no response.

Quy avatar Sep 19 '24 19:09 Quy