@readme/markdown 14.2.2 → 14.2.3

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/dist/main.js CHANGED
@@ -72718,10 +72718,17 @@ const normalizeEmphasisAST = () => (tree) => {
72718
72718
  visit(tree, 'text', function visitor(node, index, parent) {
72719
72719
  if (index === undefined || !parent)
72720
72720
  return undefined;
72721
- // Skip if inside code blocks or inline code
72721
+ // Skip if inside code blocks, inline code, or MDX JSX <code> elements.
72722
72722
  if (parent.type === 'inlineCode' || parent.type === 'code') {
72723
72723
  return undefined;
72724
72724
  }
72725
+ // The parent type check for mdxJsxTextElement/mdxJsxFlowElement handles
72726
+ // raw HTML <code>...</code> inside table cells, which the table re-parser
72727
+ // parses as MDX JSX (not as an mdast `inlineCode` node).
72728
+ if ((parent.type === 'mdxJsxTextElement' || parent.type === 'mdxJsxFlowElement') &&
72729
+ 'name' in parent && parent.name === 'code') {
72730
+ return undefined;
72731
+ }
72725
72732
  const text = node.value;
72726
72733
  const allMatches = [];
72727
72734
  [...text.matchAll(asteriskBoldRegex)].forEach(match => {
@@ -72958,16 +72965,7 @@ const parseTableNode = (processor, node) => {
72958
72965
  * Check if children are only text nodes that might contain markdown
72959
72966
  */
72960
72967
  const isTextOnly = (children) => {
72961
- return children.every(child => {
72962
- if (child && typeof child === 'object' && 'type' in child) {
72963
- if (child.type === 'text')
72964
- return true;
72965
- if (child.type === 'mdxJsxTextElement' && 'children' in child && Array.isArray(child.children)) {
72966
- return child.children.every((c) => c && typeof c === 'object' && 'type' in c && c.type === 'text');
72967
- }
72968
- }
72969
- return false;
72970
- });
72968
+ return children.every(child => child && typeof child === 'object' && 'type' in child && child.type === 'text');
72971
72969
  };
72972
72970
  /**
72973
72971
  * Convenience wrapper that extracts text content from an array of children nodes.
package/dist/main.node.js CHANGED
@@ -92912,10 +92912,17 @@ const normalizeEmphasisAST = () => (tree) => {
92912
92912
  visit(tree, 'text', function visitor(node, index, parent) {
92913
92913
  if (index === undefined || !parent)
92914
92914
  return undefined;
92915
- // Skip if inside code blocks or inline code
92915
+ // Skip if inside code blocks, inline code, or MDX JSX <code> elements.
92916
92916
  if (parent.type === 'inlineCode' || parent.type === 'code') {
92917
92917
  return undefined;
92918
92918
  }
92919
+ // The parent type check for mdxJsxTextElement/mdxJsxFlowElement handles
92920
+ // raw HTML <code>...</code> inside table cells, which the table re-parser
92921
+ // parses as MDX JSX (not as an mdast `inlineCode` node).
92922
+ if ((parent.type === 'mdxJsxTextElement' || parent.type === 'mdxJsxFlowElement') &&
92923
+ 'name' in parent && parent.name === 'code') {
92924
+ return undefined;
92925
+ }
92919
92926
  const text = node.value;
92920
92927
  const allMatches = [];
92921
92928
  [...text.matchAll(asteriskBoldRegex)].forEach(match => {
@@ -93152,16 +93159,7 @@ const parseTableNode = (processor, node) => {
93152
93159
  * Check if children are only text nodes that might contain markdown
93153
93160
  */
93154
93161
  const isTextOnly = (children) => {
93155
- return children.every(child => {
93156
- if (child && typeof child === 'object' && 'type' in child) {
93157
- if (child.type === 'text')
93158
- return true;
93159
- if (child.type === 'mdxJsxTextElement' && 'children' in child && Array.isArray(child.children)) {
93160
- return child.children.every((c) => c && typeof c === 'object' && 'type' in c && c.type === 'text');
93161
- }
93162
- }
93163
- return false;
93164
- });
93162
+ return children.every(child => child && typeof child === 'object' && 'type' in child && child.type === 'text');
93165
93163
  };
93166
93164
  /**
93167
93165
  * Convenience wrapper that extracts text content from an array of children nodes.