message: fix(docs): format line breaks in autogenerated api docs
diff: @@ -43,6 +43,15 @@ function writeAutoGeneratedPage(componentTag, fileName, data) {
  fs.writeFileSync(path, data);
  }
  +/**
  + * Formats line breaks in a multiline string to be displayed in a table.
  + * @param {*} str The string to format
  + * @returns The formatted string
  + */
  +function formatMultiline(str) {
  + return str.split('\n\n').join('<br /><br />').split('\n').join(' ');
  +}
  +
  function renderProperties({ props: properties }) {
  if (properties.length === 0) {
  return '';
  @@ -59,7 +68,7 @@ ${properties
  | | |
  | --- | --- |
  -| **Description** | ${prop.docs.split('\n').join('<br />')} |
  +| **Description** | ${formatMultiline(prop.docs)} |
  | **Attribute** | \`${prop.attr}\` |
  | **Type** | \`${prop.type.replace(/\|/g, '\uff5c')}\` |
  | **Default** | \`${prop.default}\` |
  @@ -80,7 +89,7 @@ function renderEvents({ events }) {
  | Name | Description |
  | --- | --- |
  -${events.map((event) => `| \`${event.event}\` | ${event.docs} |`).join('\n')}
  +${events.map((event) => `| \`${event.event}\` | ${formatMultiline(event.docs)} |`).join('\n')}
  `;
  }
  @@ -101,7 +110,7 @@ ${methods
  | | |
  | --- | --- |
  -| **Description** | ${method.docs.split('\n').join('<br />')} |
  +| **Description** | ${formatMultiline(method.docs)} |
  | **Signature** | \`${method.signature.replace(/\|/g, '\uff5c')}\` |
  `
  )
  @@ -120,7 +129,7 @@ function renderParts({ parts }) {
  | Name | Description |
  | --- | --- |
  -${parts.map((prop) => `| \`${prop.name}\` | ${prop.docs} |`).join('\n')}
  +${parts.map((prop) => `| \`${prop.name}\` | ${formatMultiline(prop.docs)} |`).join('\n')}
  `;
  }
  @@ -135,7 +144,7 @@ function renderCustomProps({ styles: customProps }) {
  | Name | Description |
  | --- | --- |
  -${customProps.map((prop) => `| \`${prop.name}\` | ${prop.docs} |`).join('\n')}
  +${customProps.map((prop) => `| \`${prop.name}\` | ${formatMultiline(prop.docs)} |`).join('\n')}
  `;
  }
  @@ -150,7 +159,7 @@ function renderSlots({ slots }) {
  | Name | Description |
  | --- | --- |
  -${slots.map((slot) => `| \`${slot.name}\` | ${slot.docs} |`).join('\n')}
  +${slots.map((slot) => `| \`${slot.name}\` | ${formatMultiline(slot.docs)} |`).join('\n')}
  `;
  }
  