Skip to content

Commit

Permalink
[DEV-1162] Remove workaround from parse content (#585)
Browse files Browse the repository at this point in the history
* parse content

* changeset

* Update packages/gitbook-docs/src/parseContent.ts

Co-authored-by: Marco Ponchia <[email protected]>

* Update .changeset/wicked-dots-attend.md

Co-authored-by: Marco Comi <[email protected]>

---------

Co-authored-by: Marco Ponchia <[email protected]>
Co-authored-by: Marco Comi <[email protected]>
Co-authored-by: marcobottaro <[email protected]>
  • Loading branch information
4 people authored Jan 31, 2024
1 parent d39d27a commit 7a6ee42
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-dots-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gitbook-docs": patch
---

Remove a workaround causing paragraphs to have %p inside tables
2 changes: 1 addition & 1 deletion packages/gitbook-docs/src/__tests__/parseContent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const config = {
describe('parseContent', () => {
it('should ignore any <p> tag', () => {
expect(parseContent('<p>Hello there!</p>', config)).toStrictEqual([
new Markdoc.Tag('Paragraph', {}, ['Hello there!']),
'Hello there!',
]);
});
it('should parse heading', () => {
Expand Down
2 changes: 0 additions & 2 deletions packages/gitbook-docs/src/parseContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 7a6ee42

Please sign in to comment.