RTE transform local urls to absolute

Hi

I’m creating a newsletter using my umbraco site’s backoffice. I created a
custom section where editors can add content to the newsletter using RTE.
This content is saved in a custom DB but can reference site content.

The problem arrises when editors, in RTE, add a link for a site’s content. RTE
witll render it locally, with {locallink:umb} etc attrs, but I reealy need all URLs to be
absolute ones.

Using bellow statment I managed to get relative paths but still need absolute ones because the newsletter is to be sent by email and all links must be absolute.

var content =  new HtmlLocalLinkParser(base.UmbracoContextAccessor).EnsureInternalLinks(rteArticle);

// Change from 
// href="/{localLink:umb://media/14508b4c10c64f8586bcbb0e933f38fd}"
// to
// href="/media/ksffafgg/wp216_en.pdf"
// but need
// href="https://www.mysite.com/media/ksffafgg/wp216_en.pdf"

Does umbraco have tools to change this or do I have to parse RTE text by myself changing element’s href and src?

Regards,

Jorge


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/105079-rte-transform-local-urls-to-absolute