Skip to content

tinymce: ensure urls are relative but start with the leading slash

Rodrigo Souto requested to merge diguliu/noosfero:tinymce-url-treatment into master

After the new update of Tinymce the default configuration of url treatment enforce relative urls. So in cases where the user add urls that with the same domain of the page Tinymce removes the domain. The problem is that it also removes the leading / making the url relative to the path being acessed. This was causing problems when referencing contents that were on other pages. E.g.: if Ze was posting a new article on his blog and wanted to reference an image that was on his gallery he would fill the url with /ze/gallery/my-image.png or my-domain.com/ze/gallery/my-image.png and tiny would convert it ze/gallery/my-image.png. Now when I access this post which is on /ze/blog/post-1 the url image is converted to my-domain.com/ze/blog/ze/gallery/my-image.png which obviously does not exist.

With this options the urls are always converted to the relative url with the leading /, therefore in the previous example both urls entered and also ze/gallery/my-image.png would be converted to /ze/gallery/my-image.png which will work fine everywhere.

Merge request reports