odaptos_design_system 2.0.343 → 2.0.344

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 CHANGED
@@ -316,7 +316,7 @@ style_inject_es_default(css_248z$82);
316
316
  //#region src/Atoms/Typography/renderInlineMarkdown.tsx
317
317
  /**
318
318
  * Minimal inline markdown renderer for typography components.
319
- * Supports: **bold**, *italic*, `code`, line breaks, and simple lists.
319
+ * Supports: **bold**, *italic*, __underline__ (or <u>underline</u>), `code`, line breaks, and simple lists.
320
320
  */
321
321
  const renderInlineMarkdown = (rawText) => {
322
322
  if (!rawText) return rawText;
@@ -327,6 +327,18 @@ const renderInlineMarkdown = (rawText) => {
327
327
  });
328
328
  };
329
329
  const renderStrongAndEm = (nodes) => {
330
+ const renderHtmlUnderline = (text) => {
331
+ return text.split(/<u>(.*?)<\/u>/g).map((part, index) => {
332
+ if (!(index % 2 === 1)) return part;
333
+ return /* @__PURE__ */ react.default.createElement("u", { key: `u-html-${index}` }, part);
334
+ });
335
+ };
336
+ const renderUnderline = (text) => {
337
+ return text.split(/__([^_]+)__/g).map((part, index) => {
338
+ if (!(index % 2 === 1)) return part;
339
+ return /* @__PURE__ */ react.default.createElement("u", { key: `u-${index}` }, part);
340
+ });
341
+ };
330
342
  const renderStrong = (text) => {
331
343
  return text.split(/\*\*([^*]+)\*\*/g).map((part, index) => {
332
344
  if (!(index % 2 === 1)) return part;
@@ -341,7 +353,13 @@ const renderInlineMarkdown = (rawText) => {
341
353
  };
342
354
  return nodes.flatMap((node) => {
343
355
  if (typeof node !== "string") return [node];
344
- return renderStrong(node).flatMap((strongNode) => {
356
+ return renderHtmlUnderline(node).flatMap((htmlUnderlineNode) => {
357
+ if (typeof htmlUnderlineNode !== "string") return [htmlUnderlineNode];
358
+ return renderUnderline(htmlUnderlineNode);
359
+ }).flatMap((underlineNode) => {
360
+ if (typeof underlineNode !== "string") return [underlineNode];
361
+ return renderStrong(underlineNode);
362
+ }).flatMap((strongNode) => {
345
363
  if (typeof strongNode !== "string") return [strongNode];
346
364
  return renderEm(strongNode);
347
365
  });