Open nmchapin opened 3 years ago
Hi!
You right! The origin commit is: https://github.com/Alex-D/Trumbowyg/commit/0cff83e49ec8e491f06e580ac6a1ac672cb9059d
I did not understand why I've done this change.
I think I should roll back this in the next version.
Hi @Alex-D
I think I should roll back this in the next version.
Do you plan to do it in the near future?
And there's also a PR for this issue as well #1279
Thanks for the great lib btw ❤️
When loading SVG icons for the editor from a file, the icons will fail to display if the page contains a query string. This regression was introduced in version 2.22 after the following line was introduced:
https://github.com/Alex-D/Trumbowyg/blob/ad5912734a71667ba69e992641900cab7d7db414/src/trumbowyg.js#L264
In the previous version, this line used a different argument for splitting the HREF of the current page. It looked like this:
t.svgPath = !!t.doc.querySelector('base') ? window.location.href.split('#')[0] : '';
As you can see, the HREF is split on the pound character. This allowed icons to be correctly referenced by the editor in their respective USE tags. So, for instance, a URL for referencing the "Bold" icon would look like this:
http://localhost/object/edit?page=2#trumbowyg-bold
But, due to the regression, this URL looks like this:
http://localhost/object/edit#trumbowyg-bold