@mintlify/common 1.0.1357 → 1.0.1359

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.
@@ -17,6 +17,15 @@ export const coreRemarkMdxPlugins = [
17
17
  remarkMdasticParse,
18
18
  ];
19
19
  export const coreRemark = remark().use(coreRemarkMdxPlugins).freeze();
20
+ const stringifyRemark = remark()
21
+ .use([
22
+ remarkMdx,
23
+ [remarkGfm, { tablePipeAlign: false }],
24
+ [remarkFrontmatter, ['yaml', 'toml']],
25
+ remarkMath,
26
+ remarkMdasticParse,
27
+ ])
28
+ .freeze();
20
29
  const agentRemarkMdxPlugins = [
21
30
  remarkMdx,
22
31
  [remarkGfm, { tablePipeAlign: false }],
@@ -30,5 +39,5 @@ export const getAST = (str, filePath) => {
30
39
  }
31
40
  return coreRemark().parse(preprocessCustomHeadingIds(preprocessMdxFragmentCode(str)));
32
41
  };
33
- export const stringifyTree = (tree) => coreRemark().use(remarkStringify).stringify(tree);
42
+ export const stringifyTree = (tree) => stringifyRemark().use(remarkStringify).stringify(tree);
34
43
  export const stringifyTreeForAgents = (tree) => agentRemark().use(remarkStringify).stringify(tree);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { getAST, stringifyTree } from './remark-core.js';
3
+ describe('stringifyTree', () => {
4
+ it('does not pad table cells to column width', () => {
5
+ const long = 'x'.repeat(200);
6
+ const source = `| id | comment |\n| - | - |\n| 1 | ${long} |\n| 2 | ok |\n`;
7
+ expect(stringifyTree(getAST(source))).toBe(`| id | comment |\n| - | - |\n| 1 | ${long} |\n| 2 | ok |\n`);
8
+ });
9
+ });