@readme/markdown 11.9.1 → 11.9.2

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/README.md CHANGED
@@ -140,3 +140,25 @@ npm link && npm run watch
140
140
  ```
141
141
  npm link $PATH_TO_LOCAL_MARKDOWN_REPO
142
142
  ```
143
+
144
+ ## Releases
145
+
146
+ First, update `main` with what’s on `next`:
147
+
148
+ ```
149
+ git switch next
150
+ git pull
151
+ git switch main
152
+ git pull
153
+ git merge --no-ff next
154
+ git push
155
+ ```
156
+
157
+ WAIT until the build is finished, then update `next`:
158
+
159
+ ```
160
+ git pull
161
+ git switch next
162
+ git merge main
163
+ git push
164
+ ```
package/dist/main.js CHANGED
@@ -93648,6 +93648,9 @@ const mdxishHtmlBlocks = () => tree => {
93648
93648
 
93649
93649
  ;// ./processor/transform/mdxish/mdxish-magic-blocks.ts
93650
93650
 
93651
+
93652
+
93653
+
93651
93654
  /**
93652
93655
  * Matches legacy magic block syntax: [block:TYPE]...JSON...[/block]
93653
93656
  * Group 1: block type (e.g., "image", "code", "callout")
@@ -93655,6 +93658,8 @@ const mdxishHtmlBlocks = () => tree => {
93655
93658
  * Taken from the v6 branch
93656
93659
  */
93657
93660
  const RGXP = /^\s*\[block:([^\]]*)\]([^]+?)\[\/block\]/;
93661
+ /** Parses markdown in table cells */
93662
+ const cellParser = unified().use(remarkParse).use(remarkGfm);
93658
93663
  /**
93659
93664
  * Wraps a node in a "pinned" container if sidebar: true is set in the JSON.
93660
93665
  * Pinned blocks are displayed in a sidebar/floating position in the UI.
@@ -93688,6 +93693,15 @@ const imgWidthBySize = new Proxy(imgSizeValues, {
93688
93693
  const textToInline = (text) => [{ type: 'text', value: text }];
93689
93694
  // Simple text to block nodes (wraps in paragraph)
93690
93695
  const textToBlock = (text) => [{ children: textToInline(text), type: 'paragraph' }];
93696
+ // Table cells may contain html or markdown content, so we need to parse it accordingly instead of keeping it as raw text
93697
+ const parseInline = (text) => {
93698
+ if (!text.trim())
93699
+ return [{ type: 'text', value: '' }];
93700
+ const tree = cellParser.runSync(cellParser.parse(text));
93701
+ return tree.children.flatMap(n =>
93702
+ // This unwraps the extra p node that might appear & wrapping the content
93703
+ n.type === 'paragraph' && 'children' in n ? n.children : [n]);
93704
+ };
93691
93705
  /**
93692
93706
  * Parse a magic block string and return MDAST nodes.
93693
93707
  *
@@ -93839,7 +93853,7 @@ function parseMagicBlock(raw, options = {}) {
93839
93853
  return mapped;
93840
93854
  }, []);
93841
93855
  // In compatibility mode, wrap cell content in paragraphs; otherwise inline text
93842
- const tokenizeCell = compatibilityMode ? textToBlock : textToInline;
93856
+ const tokenizeCell = compatibilityMode ? textToBlock : parseInline;
93843
93857
  const children = Array.from({ length: rows + 1 }, (_, y) => ({
93844
93858
  children: Array.from({ length: cols }, (__, x) => ({
93845
93859
  children: sparseData[y]?.[x] ? tokenizeCell(sparseData[y][x]) : [{ type: 'text', value: '' }],
package/dist/main.node.js CHANGED
@@ -113852,6 +113852,9 @@ const mdxishHtmlBlocks = () => tree => {
113852
113852
 
113853
113853
  ;// ./processor/transform/mdxish/mdxish-magic-blocks.ts
113854
113854
 
113855
+
113856
+
113857
+
113855
113858
  /**
113856
113859
  * Matches legacy magic block syntax: [block:TYPE]...JSON...[/block]
113857
113860
  * Group 1: block type (e.g., "image", "code", "callout")
@@ -113859,6 +113862,8 @@ const mdxishHtmlBlocks = () => tree => {
113859
113862
  * Taken from the v6 branch
113860
113863
  */
113861
113864
  const RGXP = /^\s*\[block:([^\]]*)\]([^]+?)\[\/block\]/;
113865
+ /** Parses markdown in table cells */
113866
+ const cellParser = unified().use(remarkParse).use(remarkGfm);
113862
113867
  /**
113863
113868
  * Wraps a node in a "pinned" container if sidebar: true is set in the JSON.
113864
113869
  * Pinned blocks are displayed in a sidebar/floating position in the UI.
@@ -113892,6 +113897,15 @@ const imgWidthBySize = new Proxy(imgSizeValues, {
113892
113897
  const textToInline = (text) => [{ type: 'text', value: text }];
113893
113898
  // Simple text to block nodes (wraps in paragraph)
113894
113899
  const textToBlock = (text) => [{ children: textToInline(text), type: 'paragraph' }];
113900
+ // Table cells may contain html or markdown content, so we need to parse it accordingly instead of keeping it as raw text
113901
+ const parseInline = (text) => {
113902
+ if (!text.trim())
113903
+ return [{ type: 'text', value: '' }];
113904
+ const tree = cellParser.runSync(cellParser.parse(text));
113905
+ return tree.children.flatMap(n =>
113906
+ // This unwraps the extra p node that might appear & wrapping the content
113907
+ n.type === 'paragraph' && 'children' in n ? n.children : [n]);
113908
+ };
113895
113909
  /**
113896
113910
  * Parse a magic block string and return MDAST nodes.
113897
113911
  *
@@ -114043,7 +114057,7 @@ function parseMagicBlock(raw, options = {}) {
114043
114057
  return mapped;
114044
114058
  }, []);
114045
114059
  // In compatibility mode, wrap cell content in paragraphs; otherwise inline text
114046
- const tokenizeCell = compatibilityMode ? textToBlock : textToInline;
114060
+ const tokenizeCell = compatibilityMode ? textToBlock : parseInline;
114047
114061
  const children = Array.from({ length: rows + 1 }, (_, y) => ({
114048
114062
  children: Array.from({ length: cols }, (__, x) => ({
114049
114063
  children: sparseData[y]?.[x] ? tokenizeCell(sparseData[y][x]) : [{ type: 'text', value: '' }],