(v6 core) Text editor ... external links

Hello,
I’m using text editor and when creating a link to an external website with the button and later when it shows this text on the app, the link try to access to a route inside the app and it shows the 404 page error…
Can be changed the link to go to an exernal url?
Thanks in advance

Is your app cordova based?

Post the piece of code.
In tag <a></a> tag target=’_blank’ or class=‘external-link’

Text Editor created the a link by itself when presing the chain button… it show a dialog to add the url and the it created the A tag around the selected text… but the Text Editor don’t add the class=“external” to the created A tag… so it’s needed to add the class=“external” by code to every A tag created by the Text Editor…? Text Editor can’t do this in any parameter? There is no way of make different links (internal routes or external links) using the text editor?

To do that must I create another button with my personal code and hide the original text editor chain button?

I’ve made this way, before upload the content of text editor to my backend I add the class external to every A tag but only if the tag have http in the first characters, and remove the external class if don’t… I must improve this, because the link can be email, tel… and so… and maybe because other conditions i’ve not consider yet… But it’s a beginning:

              var arrATags = document.getElementById("obj_longdesc").getElementsByTagName("A");
              for (var i=0; i<arrATags.length; i++) {
                var hrefFirst4Chars = arrATags[i].attributes.href.value.substring(0,4);
                if (hrefFirst4Chars == "http") {
                  arrATags[i].classList.add("external");
                } else {
                  arrATags[i].classList.remove("external");
                }
              }
              var obj_longdesc = document.getElementById("obj_longdesc").innerHTML;

Too, in my PHP backend i’m using http://htmlpurifier.org/ to clean the HTML before save it to database…