@docusaurus/mdx-loader 2.0.0-beta.18 → 2.0.0-beta.19

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.
@@ -103,7 +103,7 @@ async function getImageAbsolutePath(
103
103
  await ensureImageFileExist(imageFilePath, filePath);
104
104
  return imageFilePath;
105
105
  } else if (path.isAbsolute(imagePath)) {
106
- // absolute paths are expected to exist in the static folder
106
+ // Absolute paths are expected to exist in the static folder.
107
107
  const possiblePaths = staticDirs.map((dir) => path.join(dir, imagePath));
108
108
  const imageFilePath = await findAsyncSequential(
109
109
  possiblePaths,
@@ -120,7 +120,7 @@ async function getImageAbsolutePath(
120
120
  }
121
121
  return imageFilePath;
122
122
  }
123
- // relative paths are resolved against the source file's folder
123
+ // Relative paths are resolved against the source file's folder.
124
124
  const imageFilePath = path.join(
125
125
  path.dirname(filePath),
126
126
  decodeURIComponent(imagePath),
@@ -34,7 +34,9 @@ type Context = PluginOptions & {
34
34
  filePath: string;
35
35
  };
36
36
 
37
- // transform the link node to a jsx link with a require() call
37
+ /**
38
+ * Transforms the link node to a JSX `<a>` element with a `require()` call.
39
+ */
38
40
  function toAssetRequireNode(node: Link, assetPath: string, filePath: string) {
39
41
  const jsxNode = node as Literal & Partial<Link>;
40
42
  let relativeAssetPath = posixPath(
@@ -106,7 +108,7 @@ async function getAssetAbsolutePath(
106
108
 
107
109
  async function processLinkNode(node: Link, context: Context) {
108
110
  if (!node.url) {
109
- // try to improve error feedback
111
+ // Try to improve error feedback
110
112
  // see https://github.com/facebook/docusaurus/issues/3309#issuecomment-690371675
111
113
  const title = node.title || (node.children[0] as Literal)?.value || '?';
112
114
  const line = node?.position?.start?.line || '?';
@@ -1,18 +0,0 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- import type {Plugin} from 'unified';
9
-
10
- export type RemarkOrRehypePlugin =
11
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
- [Plugin<any[]>, any] | Plugin<any[]>;
13
- export type RemarkAndRehypePluginOptions = {
14
- remarkPlugins: RemarkOrRehypePlugin[];
15
- rehypePlugins: RemarkOrRehypePlugin[];
16
- beforeDefaultRemarkPlugins: RemarkOrRehypePlugin[];
17
- beforeDefaultRehypePlugins: RemarkOrRehypePlugin[];
18
- };