@bobfrankston/rmfmail 1.1.236 → 1.1.238

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2010,7 +2010,12 @@ function escapeHtml(s) {
2010
2010
  }
2011
2011
  function linkifyText(text) {
2012
2012
  const escaped = text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
2013
- return escaped.replace(/(https?:\/\/[^\s<>"')\]]+)/g, '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>');
2013
+ return escaped.replace(/(https?:\/\/[^\s<>"')\]]+)/g, (match) => {
2014
+ const m = match.match(/^(.*?)([.,;:!?]+)$/);
2015
+ const url = m ? m[1] : match;
2016
+ const trailer = m ? m[2] : "";
2017
+ return `<a href="${url}" target="_blank" rel="noopener noreferrer">${url}</a>${trailer}`;
2018
+ });
2014
2019
  }
2015
2020
  function escapeText(s) {
2016
2021
  const div = document.createElement("div");