odaptos_design_system 2.0.347 → 2.0.349
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.
- package/dist/index.cjs +21 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -265,7 +265,9 @@ style_inject_es_default(css_248z$82);
|
|
|
265
265
|
* Supports: **bold**, *italic*, __underline__ (or <u>underline</u>), `code`, line breaks, and simple lists.
|
|
266
266
|
*/
|
|
267
267
|
const renderInlineMarkdown = (rawText) => {
|
|
268
|
-
if (
|
|
268
|
+
if (rawText === null || rawText === void 0) return rawText;
|
|
269
|
+
if (typeof rawText !== "string") return rawText;
|
|
270
|
+
if (rawText.length === 0) return rawText;
|
|
269
271
|
const renderCode = (text) => {
|
|
270
272
|
return text.split(/`([^`]+)`/g).map((part, index) => {
|
|
271
273
|
if (!(index % 2 === 1)) return part;
|
|
@@ -302,9 +304,16 @@ const renderInlineMarkdown = (rawText) => {
|
|
|
302
304
|
});
|
|
303
305
|
};
|
|
304
306
|
const renderHtmlUnderline = (text) => {
|
|
307
|
+
const renderUnderlineContent = (underlineText) => {
|
|
308
|
+
const tripleStarAsStrongNodes = underlineText.split(/\*\*\*([^*]+)\*\*\*/g).map((part, index) => {
|
|
309
|
+
if (!(index % 2 === 1)) return part;
|
|
310
|
+
return /* @__PURE__ */ React.createElement("strong", { key: `u-strong-em-from-triple-${index}` }, /* @__PURE__ */ React.createElement("em", null, part));
|
|
311
|
+
});
|
|
312
|
+
return renderStrongAndEm(tripleStarAsStrongNodes);
|
|
313
|
+
};
|
|
305
314
|
return text.split(/<u>(.*?)<\/u>/g).map((part, index) => {
|
|
306
315
|
if (!(index % 2 === 1)) return part;
|
|
307
|
-
return /* @__PURE__ */ React.createElement("u", { key: `u-html-${index}` }, part);
|
|
316
|
+
return /* @__PURE__ */ React.createElement("u", { key: `u-html-${index}` }, renderUnderlineContent(part));
|
|
308
317
|
});
|
|
309
318
|
};
|
|
310
319
|
const renderUnderline = (text) => {
|
|
@@ -319,6 +328,12 @@ const renderInlineMarkdown = (rawText) => {
|
|
|
319
328
|
return /* @__PURE__ */ React.createElement("strong", { key: `strong-${index}` }, part);
|
|
320
329
|
});
|
|
321
330
|
};
|
|
331
|
+
const renderStrongAndEmphasis = (text) => {
|
|
332
|
+
return text.split(/\*\*\*([^*]+)\*\*\*/g).map((part, index) => {
|
|
333
|
+
if (!(index % 2 === 1)) return part;
|
|
334
|
+
return /* @__PURE__ */ React.createElement("strong", { key: `strong-em-${index}` }, /* @__PURE__ */ React.createElement("u", null, part));
|
|
335
|
+
});
|
|
336
|
+
};
|
|
322
337
|
const renderEm = (text) => {
|
|
323
338
|
return text.split(/\*([^*]+)\*/g).map((part, index) => {
|
|
324
339
|
if (!(index % 2 === 1)) return part;
|
|
@@ -344,7 +359,10 @@ const renderInlineMarkdown = (rawText) => {
|
|
|
344
359
|
return renderUnderline(htmlUnderlineNode);
|
|
345
360
|
}).flatMap((underlineNode) => {
|
|
346
361
|
if (typeof underlineNode !== "string") return [underlineNode];
|
|
347
|
-
return
|
|
362
|
+
return renderStrongAndEmphasis(underlineNode);
|
|
363
|
+
}).flatMap((strongAndEmphasisNode) => {
|
|
364
|
+
if (typeof strongAndEmphasisNode !== "string") return [strongAndEmphasisNode];
|
|
365
|
+
return renderStrong(strongAndEmphasisNode);
|
|
348
366
|
}).flatMap((strongNode) => {
|
|
349
367
|
if (typeof strongNode !== "string") return [strongNode];
|
|
350
368
|
return renderEm(strongNode);
|