@readme/markdown 11.2.0 → 11.3.0

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
@@ -9211,11 +9211,15 @@ const Image = (Props) => {
9211
9211
  external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("span", { "aria-label": alt, className: `img lightbox ${lightbox ? 'open' : 'closed'}`, onClick: toggle, onKeyDown: handleKeyDown, role: 'button', tabIndex: 0 },
9212
9212
  external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("span", { className: "lightbox-inner" },
9213
9213
  external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("img", { alt: alt, className: `img img-align-center ${border ? 'border' : ''}`, height: height, loading: lazy ? 'lazy' : 'eager', src: src, title: title, width: width }),
9214
- external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("figcaption", null, children || caption)))));
9214
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("figcaption", null, children || caption))),
9215
+ lightbox && (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("button", { "aria-label": "Minimize image", className: "lightbox-close", type: "button" },
9216
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("i", { "aria-hidden": "true", className: "fa-solid fa-xmark" })))));
9215
9217
  }
9216
9218
  return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("span", { "aria-label": `${lightbox ? 'Collapse image' : 'Expand image'}`, className: `img lightbox ${lightbox ? 'open' : 'closed'}`, onClick: toggle, onKeyDown: handleKeyDown, role: 'button', tabIndex: 0 },
9217
9219
  external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("span", { className: "lightbox-inner" },
9218
- external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("img", { alt: alt, className: `img ${align ? `img-align-${align}` : ''} ${border ? 'border' : ''}`, height: height, loading: lazy ? 'lazy' : 'eager', src: src, title: title, width: width }))));
9220
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("img", { alt: alt, className: `img ${align ? `img-align-${align}` : ''} ${border ? 'border' : ''}`, height: height, loading: lazy ? 'lazy' : 'eager', src: src, title: title, width: width })),
9221
+ lightbox && (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("button", { "aria-label": "Minimize image", className: "lightbox-close", type: "button" },
9222
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("i", { "aria-hidden": "true", className: "fa-solid fa-xmark" })))));
9219
9223
  };
9220
9224
  /* harmony default export */ const components_Image = (Image);
9221
9225
 
@@ -9231,13 +9235,13 @@ const Table = (props) => {
9231
9235
 
9232
9236
  ;// ./components/TableOfContents/index.tsx
9233
9237
 
9234
- function TableOfContents({ children }) {
9238
+ function TableOfContents({ children, heading = 'Table of Contents' }) {
9235
9239
  return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("nav", { "aria-label": "Table of contents", role: "navigation" },
9236
9240
  external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("ul", { className: "toc-list" },
9237
9241
  external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("li", null,
9238
9242
  external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("a", { className: "tocHeader", href: "#" },
9239
9243
  external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("i", { className: "icon icon-text-align-left" }),
9240
- "Table of Contents")),
9244
+ heading)),
9241
9245
  external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("li", { className: "toc-children" }, children))));
9242
9246
  }
9243
9247
  /* harmony default export */ const components_TableOfContents = (TableOfContents);
@@ -87663,6 +87667,22 @@ function compilers() {
87663
87667
  }
87664
87668
  /* harmony default export */ const processor_compile = (compilers);
87665
87669
 
87670
+ ;// ./processor/transform/escape-pipes-in-tables.ts
87671
+
87672
+ const escapePipesInTables = () => tree => {
87673
+ visit(tree, 'table', tableNode => {
87674
+ visit(tableNode, leaf => {
87675
+ if (!('value' in leaf))
87676
+ return;
87677
+ if (leaf.value.match(/|/g)) {
87678
+ // escape only unescaped pipes
87679
+ leaf.value = leaf.value.replaceAll(/(?<!\\(\\\\)*)\|/g, '\\|');
87680
+ }
87681
+ });
87682
+ return SKIP;
87683
+ });
87684
+ };
87685
+
87666
87686
  ;// ./lib/mdx.ts
87667
87687
 
87668
87688
 
@@ -87671,6 +87691,7 @@ function compilers() {
87671
87691
 
87672
87692
 
87673
87693
 
87694
+
87674
87695
  const mdx_mdx = (tree, { hast = false, remarkTransformers = [], file, ...opts } = {}) => {
87675
87696
  const processor = unified()
87676
87697
  .use(hast ? rehypeRemark : undefined)
@@ -87681,6 +87702,7 @@ const mdx_mdx = (tree, { hast = false, remarkTransformers = [], file, ...opts }
87681
87702
  .use(readme_to_mdx)
87682
87703
  .use(tables_to_jsx)
87683
87704
  .use(compatability)
87705
+ .use(escapePipesInTables)
87684
87706
  .use(processor_compile)
87685
87707
  .use(remarkStringify, opts);
87686
87708
  // @ts-expect-error - @todo: coerce the processor and tree to the correct
@@ -87898,8 +87920,8 @@ const run_run = (string, _opts = {}) => {
87898
87920
  default: (props) => (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(contexts, { baseUrl: baseUrl, copyButtons: copyButtons, terms: terms, theme: theme, variables: variables },
87899
87921
  external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(Content, { ...props }))),
87900
87922
  toc,
87901
- Toc: props => Toc ? (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(components_TableOfContents, null,
87902
- external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(Toc, { ...props }))) : null,
87923
+ Toc: (props) => Toc ? (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(components_TableOfContents, { heading: props.heading },
87924
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(Toc, null))) : null,
87903
87925
  stylesheet,
87904
87926
  ...exports,
87905
87927
  };
package/dist/main.node.js CHANGED
@@ -21824,11 +21824,15 @@ const Image = (Props) => {
21824
21824
  external_react_.createElement("span", { "aria-label": alt, className: `img lightbox ${lightbox ? 'open' : 'closed'}`, onClick: toggle, onKeyDown: handleKeyDown, role: 'button', tabIndex: 0 },
21825
21825
  external_react_.createElement("span", { className: "lightbox-inner" },
21826
21826
  external_react_.createElement("img", { alt: alt, className: `img img-align-center ${border ? 'border' : ''}`, height: height, loading: lazy ? 'lazy' : 'eager', src: src, title: title, width: width }),
21827
- external_react_.createElement("figcaption", null, children || caption)))));
21827
+ external_react_.createElement("figcaption", null, children || caption))),
21828
+ lightbox && (external_react_.createElement("button", { "aria-label": "Minimize image", className: "lightbox-close", type: "button" },
21829
+ external_react_.createElement("i", { "aria-hidden": "true", className: "fa-solid fa-xmark" })))));
21828
21830
  }
21829
21831
  return (external_react_.createElement("span", { "aria-label": `${lightbox ? 'Collapse image' : 'Expand image'}`, className: `img lightbox ${lightbox ? 'open' : 'closed'}`, onClick: toggle, onKeyDown: handleKeyDown, role: 'button', tabIndex: 0 },
21830
21832
  external_react_.createElement("span", { className: "lightbox-inner" },
21831
- external_react_.createElement("img", { alt: alt, className: `img ${align ? `img-align-${align}` : ''} ${border ? 'border' : ''}`, height: height, loading: lazy ? 'lazy' : 'eager', src: src, title: title, width: width }))));
21833
+ external_react_.createElement("img", { alt: alt, className: `img ${align ? `img-align-${align}` : ''} ${border ? 'border' : ''}`, height: height, loading: lazy ? 'lazy' : 'eager', src: src, title: title, width: width })),
21834
+ lightbox && (external_react_.createElement("button", { "aria-label": "Minimize image", className: "lightbox-close", type: "button" },
21835
+ external_react_.createElement("i", { "aria-hidden": "true", className: "fa-solid fa-xmark" })))));
21832
21836
  };
21833
21837
  /* harmony default export */ const components_Image = (Image);
21834
21838
 
@@ -21844,13 +21848,13 @@ const Table = (props) => {
21844
21848
 
21845
21849
  ;// ./components/TableOfContents/index.tsx
21846
21850
 
21847
- function TableOfContents({ children }) {
21851
+ function TableOfContents({ children, heading = 'Table of Contents' }) {
21848
21852
  return (external_react_default().createElement("nav", { "aria-label": "Table of contents", role: "navigation" },
21849
21853
  external_react_default().createElement("ul", { className: "toc-list" },
21850
21854
  external_react_default().createElement("li", null,
21851
21855
  external_react_default().createElement("a", { className: "tocHeader", href: "#" },
21852
21856
  external_react_default().createElement("i", { className: "icon icon-text-align-left" }),
21853
- "Table of Contents")),
21857
+ heading)),
21854
21858
  external_react_default().createElement("li", { className: "toc-children" }, children))));
21855
21859
  }
21856
21860
  /* harmony default export */ const components_TableOfContents = (TableOfContents);
@@ -107874,6 +107878,22 @@ function compilers() {
107874
107878
  }
107875
107879
  /* harmony default export */ const processor_compile = (compilers);
107876
107880
 
107881
+ ;// ./processor/transform/escape-pipes-in-tables.ts
107882
+
107883
+ const escapePipesInTables = () => tree => {
107884
+ visit(tree, 'table', tableNode => {
107885
+ visit(tableNode, leaf => {
107886
+ if (!('value' in leaf))
107887
+ return;
107888
+ if (leaf.value.match(/|/g)) {
107889
+ // escape only unescaped pipes
107890
+ leaf.value = leaf.value.replaceAll(/(?<!\\(\\\\)*)\|/g, '\\|');
107891
+ }
107892
+ });
107893
+ return SKIP;
107894
+ });
107895
+ };
107896
+
107877
107897
  ;// ./lib/mdx.ts
107878
107898
 
107879
107899
 
@@ -107882,6 +107902,7 @@ function compilers() {
107882
107902
 
107883
107903
 
107884
107904
 
107905
+
107885
107906
  const mdx_mdx = (tree, { hast = false, remarkTransformers = [], file, ...opts } = {}) => {
107886
107907
  const processor = unified()
107887
107908
  .use(hast ? rehypeRemark : undefined)
@@ -107892,6 +107913,7 @@ const mdx_mdx = (tree, { hast = false, remarkTransformers = [], file, ...opts }
107892
107913
  .use(readme_to_mdx)
107893
107914
  .use(tables_to_jsx)
107894
107915
  .use(compatability)
107916
+ .use(escapePipesInTables)
107895
107917
  .use(processor_compile)
107896
107918
  .use(remarkStringify, opts);
107897
107919
  // @ts-expect-error - @todo: coerce the processor and tree to the correct
@@ -108109,8 +108131,8 @@ const run_run = (string, _opts = {}) => {
108109
108131
  default: (props) => (external_react_default().createElement(contexts, { baseUrl: baseUrl, copyButtons: copyButtons, terms: terms, theme: theme, variables: variables },
108110
108132
  external_react_default().createElement(Content, { ...props }))),
108111
108133
  toc,
108112
- Toc: props => Toc ? (external_react_default().createElement(components_TableOfContents, null,
108113
- external_react_default().createElement(Toc, { ...props }))) : null,
108134
+ Toc: (props) => Toc ? (external_react_default().createElement(components_TableOfContents, { heading: props.heading },
108135
+ external_react_default().createElement(Toc, null))) : null,
108114
108136
  stylesheet,
108115
108137
  ...exports,
108116
108138
  };