diff --git a/.changeset/wicked-dots-attend.md b/.changeset/wicked-dots-attend.md new file mode 100644 index 0000000000..b1ecda41f0 --- /dev/null +++ b/.changeset/wicked-dots-attend.md @@ -0,0 +1,5 @@ +--- +"gitbook-docs": patch +--- + +Remove a workaround causing paragraphs to have %p inside tables diff --git a/packages/gitbook-docs/src/__tests__/parseContent.test.ts b/packages/gitbook-docs/src/__tests__/parseContent.test.ts index 42bfa22f3a..e99ecccf3b 100644 --- a/packages/gitbook-docs/src/__tests__/parseContent.test.ts +++ b/packages/gitbook-docs/src/__tests__/parseContent.test.ts @@ -35,7 +35,7 @@ const config = { describe('parseContent', () => { it('should ignore any

tag', () => { expect(parseContent('

Hello there!

', config)).toStrictEqual([ - new Markdoc.Tag('Paragraph', {}, ['Hello there!']), + 'Hello there!', ]); }); it('should parse heading', () => { diff --git a/packages/gitbook-docs/src/parseContent.ts b/packages/gitbook-docs/src/parseContent.ts index bcd1d8f21a..f81159809b 100644 --- a/packages/gitbook-docs/src/parseContent.ts +++ b/packages/gitbook-docs/src/parseContent.ts @@ -44,7 +44,6 @@ const imgR = unpairedHtmlTag('img'); const figureR = pairedHtmlTag('figure'); const figcaptionR = pairedHtmlTag('figcaption'); const markR = pairedHtmlTag('mark'); -const pR = pairedHtmlTag('p'); const detailsR = pairedHtmlTag('details'); const summaryR = pairedHtmlTag('summary'); const fileR = { @@ -101,7 +100,6 @@ export const parseAst = (markdown: string) => { .replaceAll(figureR.regex, figureR.replace) .replaceAll(figcaptionR.regex, figcaptionR.replace) .replaceAll(markR.regex, markR.replace) - .replaceAll(pR.regex, pR.replace) .replaceAll(detailsR.regex, detailsR.replace) .replaceAll(summaryR.regex, summaryR.replace) .replaceAll('{% @figma/embed', '{% figma-embed')