如何为在 rte 中编写的超链接添加域名?

how do I prepend domain name for a hyperlink authored in rte?

我有一个电子邮件模板,其中有几个使用 RTE 编辑器编写的超链接。 例如:

<a href=\"/consumer/en-us/site-configurations/external-link/accounts.html

我的 java osgi 服务将整个电子邮件 template/page 作为 html 发送到触发电子邮件的后端业务层。

如何在触发电子邮件之前将 osgi 服务 <a href=\"/consumer/en-us/site-configurations/external-link/accounts.html 替换为 <a href=www.domain.com/consumer/en-us/site-configurations/external-link/accounts.html

以下对我有用:

运行 通过使用正则表达式的模式匹配器并提取相对 link。 通过外置器传递它。 将所有 relativeLink 替换为从 externalizer 接收到的新 link 将精炼后的 html 发送回业务层。 将整个代码放在静态同步方法中。