@readme/markdown 7.10.1 → 7.10.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.
Files changed (44) hide show
  1. package/components/Image/index.tsx +1 -1
  2. package/dist/lib/migrate.d.ts +3 -1
  3. package/dist/main.js +19 -28
  4. package/dist/main.node.js +419 -5471
  5. package/dist/processor/migration/index.d.ts +2 -1
  6. package/dist/processor/migration/table-cell.d.ts +1 -1
  7. package/package.json +2 -2
  8. package/dist/10.node.js +0 -22721
  9. package/dist/11.node.js +0 -1443
  10. package/dist/120.node.js +0 -22
  11. package/dist/134.node.js +0 -22
  12. package/dist/150.node.js +0 -1891
  13. package/dist/17.node.js +0 -1376
  14. package/dist/246.node.js +0 -1932
  15. package/dist/351.node.js +0 -2403
  16. package/dist/366.node.js +0 -1184
  17. package/dist/403.node.js +0 -2195
  18. package/dist/429.node.js +0 -11133
  19. package/dist/485.node.js +0 -517
  20. package/dist/486.node.js +0 -31818
  21. package/dist/488.node.js +0 -58
  22. package/dist/489.node.js +0 -18475
  23. package/dist/510.node.js +0 -249
  24. package/dist/52.node.js +0 -811
  25. package/dist/550.node.js +0 -1456
  26. package/dist/551.node.js +0 -2725
  27. package/dist/617.node.js +0 -22
  28. package/dist/687.node.js +0 -3674
  29. package/dist/745.node.js +0 -7507
  30. package/dist/775.node.js +0 -1903
  31. package/dist/786.node.js +0 -31381
  32. package/dist/788.node.js +0 -1024
  33. package/dist/81.node.js +0 -385
  34. package/dist/849.node.js +0 -2589
  35. package/dist/863.node.js +0 -22
  36. package/dist/867.node.js +0 -1417
  37. package/dist/881.node.js +0 -1279
  38. package/dist/885.node.js +0 -51
  39. package/dist/896.node.js +0 -1616
  40. package/dist/906.node.js +0 -1818
  41. package/dist/91.node.js +0 -22
  42. package/dist/940.node.js +0 -3362
  43. package/dist/952.node.js +0 -246
  44. package/dist/995.node.js +0 -5737
@@ -88,7 +88,7 @@ const Image = (Props: ImageProps) => {
88
88
 
89
89
  return (
90
90
  <span
91
- aria-label={alt}
91
+ aria-label={`${lightbox ? 'Collapse image' : 'Expand image'}`}
92
92
  className={`img lightbox ${lightbox ? 'open' : 'closed'}`}
93
93
  onClick={toggle}
94
94
  onKeyDown={handleKeyDown}
@@ -1,2 +1,4 @@
1
- declare const migrate: (doc: string) => string;
1
+ declare const migrate: (doc: string, { rdmd }: {
2
+ rdmd: any;
3
+ }) => string;
2
4
  export default migrate;
package/dist/main.js CHANGED
@@ -1,13 +1,13 @@
1
1
  (function webpackUniversalModuleDefinition(root, factory) {
2
2
  if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("@readme/markdown-legacy"), require("@readme/variable"), require("@tippyjs/react"), require("mermaid"), require("react"));
3
+ module.exports = factory(require("@readme/variable"), require("@tippyjs/react"), require("mermaid"), require("react"));
4
4
  else if(typeof define === 'function' && define.amd)
5
- define(["@readme/markdown-legacy", "@readme/variable", "@tippyjs/react", "mermaid", "react"], factory);
5
+ define(["@readme/variable", "@tippyjs/react", "mermaid", "react"], factory);
6
6
  else {
7
- var a = typeof exports === 'object' ? factory(require("@readme/markdown-legacy"), require("@readme/variable"), require("@tippyjs/react"), require("mermaid"), require("react")) : factory(root["@readme/markdown-legacy"], root["@readme/variable"], root["@tippyjs/react"], root["mermaid"], root["React"]);
7
+ var a = typeof exports === 'object' ? factory(require("@readme/variable"), require("@tippyjs/react"), require("mermaid"), require("react")) : factory(root["@readme/variable"], root["@tippyjs/react"], root["mermaid"], root["React"]);
8
8
  for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
9
  }
10
- })(self, (__WEBPACK_EXTERNAL_MODULE__7374__, __WEBPACK_EXTERNAL_MODULE__8167__, __WEBPACK_EXTERNAL_MODULE__6570__, __WEBPACK_EXTERNAL_MODULE__1387__, __WEBPACK_EXTERNAL_MODULE__1307__) => {
10
+ })(self, (__WEBPACK_EXTERNAL_MODULE__8167__, __WEBPACK_EXTERNAL_MODULE__6570__, __WEBPACK_EXTERNAL_MODULE__1387__, __WEBPACK_EXTERNAL_MODULE__1307__) => {
11
11
  return /******/ (() => { // webpackBootstrap
12
12
  /******/ var __webpack_modules__ = ({
13
13
 
@@ -13163,14 +13163,6 @@ module.exports = function () {
13163
13163
  };
13164
13164
 
13165
13165
 
13166
- /***/ }),
13167
-
13168
- /***/ 7374:
13169
- /***/ ((module) => {
13170
-
13171
- "use strict";
13172
- module.exports = __WEBPACK_EXTERNAL_MODULE__7374__;
13173
-
13174
13166
  /***/ }),
13175
13167
 
13176
13168
  /***/ 8167:
@@ -13896,7 +13888,7 @@ const Image = (Props) => {
13896
13888
  external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("img", { src: src, width: width, height: height, title: title, className: `img img-align-center ${border ? 'border' : ''}`, alt: alt, loading: lazy ? 'lazy' : 'eager' }),
13897
13889
  external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("figcaption", null, children || caption)))));
13898
13890
  }
13899
- return (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 },
13891
+ 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 },
13900
13892
  external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("span", { className: "lightbox-inner" },
13901
13893
  external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("img", { src: src, width: width, height: height, title: title, className: `img ${align ? `img-align-${align}` : ''} ${border ? 'border' : ''}`, alt: alt, loading: lazy ? 'lazy' : 'eager' }))));
13902
13894
  };
@@ -78559,8 +78551,6 @@ const hast = (text, opts = {}) => {
78559
78551
  };
78560
78552
  /* harmony default export */ const lib_hast = (hast);
78561
78553
 
78562
- // EXTERNAL MODULE: external "@readme/markdown-legacy"
78563
- var markdown_legacy_ = __webpack_require__(7374);
78564
78554
  ;// ./processor/migration/emphasis.ts
78565
78555
 
78566
78556
  const emphasis_strongTest = (node) => ['emphasis', 'strong'].includes(node.type);
@@ -78646,7 +78636,6 @@ const linkReferenceTransformer = () => (tree) => {
78646
78636
 
78647
78637
  ;// ./processor/migration/table-cell.ts
78648
78638
 
78649
-
78650
78639
  const magicIndex = (i, j) => `${i === 0 ? 'h' : `${i - 1}`}-${j}`;
78651
78640
  const isInlineHtml = node => node.type === 'html' && !node.block;
78652
78641
  // @note: This regex is detect malformed lists that were created by the
@@ -78671,7 +78660,7 @@ const isInlineHtml = node => node.type === 'html' && !node.block;
78671
78660
  // The following regex attempts to detect this pattern, and we'll convert it to
78672
78661
  // something more standard.
78673
78662
  const psuedoListRegex = /^(?![ \t]*([*_]+).*\1[ \t]*$)(?<ws>[ \t]*)\\?([*_])\s*(?<item>.*)$/gm;
78674
- const migrateTableCells = (vfile) => (table) => {
78663
+ const migrateTableCells = (vfile, rdmd) => (table) => {
78675
78664
  let json;
78676
78665
  try {
78677
78666
  const { position } = table;
@@ -78696,7 +78685,7 @@ const migrateTableCells = (vfile) => (table) => {
78696
78685
  let children = cell.children;
78697
78686
  if (json && json.data[magicIndex(i, j)]) {
78698
78687
  const string = json.data[magicIndex(i, j)].replace(psuedoListRegex, '$<ws>- $<item>');
78699
- children = markdown_legacy_.mdast(string).children;
78688
+ children = rdmd.mdast(string).children;
78700
78689
  }
78701
78690
  cell.children =
78702
78691
  children.length > 1 && !children.some(isInlineHtml)
@@ -78713,10 +78702,13 @@ const migrateTableCells = (vfile) => (table) => {
78713
78702
  }
78714
78703
  });
78715
78704
  };
78716
- const tableCellTransformer = () => (tree, vfile) => {
78717
- visit(tree, 'table', migrateTableCells(vfile));
78718
- return tree;
78719
- };
78705
+ function tableCellTransformer() {
78706
+ const rdmd = this.data('rdmd');
78707
+ return (tree, vfile) => {
78708
+ visit(tree, 'table', migrateTableCells(vfile, rdmd));
78709
+ return tree;
78710
+ };
78711
+ }
78720
78712
  /* harmony default export */ const table_cell = (tableCellTransformer);
78721
78713
 
78722
78714
  ;// ./processor/migration/index.ts
@@ -78734,14 +78726,13 @@ const transformers = [
78734
78726
 
78735
78727
  ;// ./lib/mdastV6.ts
78736
78728
 
78737
-
78738
78729
  const migrationNormalize = (doc) => {
78739
78730
  return doc.replaceAll(/^(<!--.*?)\\-->$/gms, '$1-->');
78740
78731
  };
78741
- const mdastV6 = (doc) => {
78742
- const [_normalizedDoc] = markdown_legacy_.setup(doc);
78732
+ const mdastV6 = (doc, { rdmd }) => {
78733
+ const [_normalizedDoc] = rdmd.setup(doc);
78743
78734
  const normalizedDoc = migrationNormalize(_normalizedDoc);
78744
- const proc = markdown_legacy_.processor().use(migration);
78735
+ const proc = rdmd.processor().use(migration).data('rdmd', rdmd);
78745
78736
  const tree = proc.parse(normalizedDoc);
78746
78737
  proc.runSync(tree, normalizedDoc);
78747
78738
  return tree;
@@ -83664,8 +83655,8 @@ const tags = (doc) => {
83664
83655
  ;// ./lib/migrate.ts
83665
83656
 
83666
83657
 
83667
- const migrate = (doc) => {
83668
- return lib_mdx(lib_mdastV6(doc)).replaceAll(/&#x20;/g, ' ');
83658
+ const migrate = (doc, { rdmd }) => {
83659
+ return lib_mdx(lib_mdastV6(doc, { rdmd })).replaceAll(/&#x20;/g, ' ');
83669
83660
  };
83670
83661
  /* harmony default export */ const lib_migrate = (migrate);
83671
83662