mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-13 17:17:28 +02:00
fix(v2): linking to asset or external html page -> don't use history.push() (#3347)
* Rework markdown links to asset require processing + add test page * implement pathname:// protocol / escape hatch at the Link level * linking to assets: fix tests + avoid creating an useless nested paragraph * fix assets linking doc * attempt to fix windows e2e test * try to fix windows errors
This commit is contained in:
parent
bd9b6618c1
commit
c7fc781ce0
21 changed files with 267 additions and 227 deletions
|
@ -14,14 +14,14 @@ const stringifyObject = require('stringify-object');
|
|||
const slug = require('./remark/slug');
|
||||
const rightToc = require('./remark/rightToc');
|
||||
const transformImage = require('./remark/transformImage');
|
||||
const tranformAsset = require('./remark/transformAssets');
|
||||
const transformLinks = require('./remark/transformLinks');
|
||||
|
||||
const DEFAULT_OPTIONS = {
|
||||
rehypePlugins: [],
|
||||
remarkPlugins: [emoji, slug, rightToc],
|
||||
};
|
||||
|
||||
module.exports = async function (fileString) {
|
||||
module.exports = async function docusaurusMdxLoader(fileString) {
|
||||
const callback = this.async();
|
||||
|
||||
const {data, content} = matter(fileString);
|
||||
|
@ -36,7 +36,7 @@ module.exports = async function (fileString) {
|
|||
{staticDir: reqOptions.staticDir, filePath: this.resourcePath},
|
||||
],
|
||||
[
|
||||
tranformAsset,
|
||||
transformLinks,
|
||||
{staticDir: reqOptions.staticDir, filePath: this.resourcePath},
|
||||
],
|
||||
...(reqOptions.remarkPlugins || []),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue