@festo-ui/react 8.2.0-dev.623 → 8.2.0-dev.625
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.
|
@@ -103,6 +103,12 @@ function TextEditor(_ref) {
|
|
|
103
103
|
if (html === "<p><br></p>" || html === "<div><br></div>" || html === undefined) {
|
|
104
104
|
html = null;
|
|
105
105
|
}
|
|
106
|
+
if (html !== null) {
|
|
107
|
+
// Repairs relative links in an HTML string by prepending "https://".
|
|
108
|
+
// It ignores links that are already absolute (http, https) as well as mailto: and tel: links.
|
|
109
|
+
const relativeLinkRegex = /href="(?!https?:\/\/|mailto:|tel:)([^"]+)"/g;
|
|
110
|
+
html = html.replace(relativeLinkRegex, 'href="https://$1"');
|
|
111
|
+
}
|
|
106
112
|
if (onChange) {
|
|
107
113
|
onChange(html);
|
|
108
114
|
}
|
|
@@ -112,6 +112,12 @@ function TextEditor(_ref) {
|
|
|
112
112
|
if (html === "<p><br></p>" || html === "<div><br></div>" || html === undefined) {
|
|
113
113
|
html = null;
|
|
114
114
|
}
|
|
115
|
+
if (html !== null) {
|
|
116
|
+
// Repairs relative links in an HTML string by prepending "https://".
|
|
117
|
+
// It ignores links that are already absolute (http, https) as well as mailto: and tel: links.
|
|
118
|
+
const relativeLinkRegex = /href="(?!https?:\/\/|mailto:|tel:)([^"]+)"/g;
|
|
119
|
+
html = html.replace(relativeLinkRegex, 'href="https://$1"');
|
|
120
|
+
}
|
|
115
121
|
if (onChange) {
|
|
116
122
|
onChange(html);
|
|
117
123
|
}
|
package/package.json
CHANGED