mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-14 01:27:35 +02:00
refactor(v2): async md image transformer + pathname protocol as an escape hatch (#3087)
* async md image transformer + pathname protocol as an escape hatch * make error messages computer agnostic by using relative paths * fix error message relative path
This commit is contained in:
parent
3e22c1ae5c
commit
6730590c1e
10 changed files with 120 additions and 64 deletions
|
@ -13,7 +13,7 @@ const matter = require('gray-matter');
|
|||
const stringifyObject = require('stringify-object');
|
||||
const slug = require('./remark/slug');
|
||||
const rightToc = require('./remark/rightToc');
|
||||
const relativePath = require('./remark/transformImage');
|
||||
const transformImage = require('./remark/transformImage');
|
||||
|
||||
const DEFAULT_OPTIONS = {
|
||||
rehypePlugins: [],
|
||||
|
@ -31,7 +31,7 @@ module.exports = async function (fileString) {
|
|||
...(reqOptions.beforeDefaultRemarkPlugins || []),
|
||||
...DEFAULT_OPTIONS.remarkPlugins,
|
||||
[
|
||||
relativePath,
|
||||
transformImage,
|
||||
{staticDir: reqOptions.staticDir, filePath: this.resourcePath},
|
||||
],
|
||||
...(reqOptions.remarkPlugins || []),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue