@builder.io/mitosis 0.6.4 → 0.6.5
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.
|
@@ -1021,7 +1021,13 @@ const builderContentPartToMitosisComponent = (builderContent, options = {}) => {
|
|
|
1021
1021
|
const voidElemRegex = /(<area|base|br|col|embed|hr|img|input|keygen|link|meta|param|source|track|wbr[^>]+)>/gm;
|
|
1022
1022
|
try {
|
|
1023
1023
|
if (((_a = elem.component) === null || _a === void 0 ? void 0 : _a.name) === 'Text') {
|
|
1024
|
-
|
|
1024
|
+
const text = elem.component.options.text;
|
|
1025
|
+
elem.component.options.text = text.replace(voidElemRegex, '$1 />');
|
|
1026
|
+
// Remove broken emojis
|
|
1027
|
+
const hasUnpairedSurrogate = /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g;
|
|
1028
|
+
if (hasUnpairedSurrogate.test(text)) {
|
|
1029
|
+
elem.component.options.text = text.replace(hasUnpairedSurrogate, '');
|
|
1030
|
+
}
|
|
1025
1031
|
}
|
|
1026
1032
|
}
|
|
1027
1033
|
catch (_error) {
|