Have you read the Contributing Guidelines on issues?
Motivation
Our current MDX loader code looks like this:
export default function markdownLoader(
this: LoaderContext<DocsMarkdownOption>,
source: string,
): void {
const fileString = source;
const callback = this.async();
const options = this.getOptions();
return callback(null, linkify(fileString, this.resourcePath, options));
}
The linkify process that turns [link](./xyz.md) to [link](/baseUrl/xyz-pathname) is based on string manipulations and regexes.
As a result, linkify has many edge case bugs related to the unability to properly resolve markdown relative file path links such as [](./relative-path.md)
We should instead do this with a Remark plugin after MDX has parsed the string.
See also:
Self-service
Have you read the Contributing Guidelines on issues?
Motivation
Our current MDX loader code looks like this:
The
linkifyprocess that turns[link](./xyz.md)to[link](/baseUrl/xyz-pathname)is based on string manipulations and regexes.As a result, linkify has many edge case bugs related to the unability to properly resolve markdown relative file path links such as
[](./relative-path.md)We should instead do this with a Remark plugin after MDX has parsed the string.
See also:
Self-service