mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 16:17:25 +02:00
chore(v2): fix several lint warnings, add missing types, cleanup (#3844)
* fix several lint warnings, add missing types, cleanup * fix EnumChangefreq issue * better utilization of EnumChangefreq type * update test snapshot
This commit is contained in:
parent
139b668737
commit
ad31facb32
49 changed files with 228 additions and 171 deletions
|
@ -18,21 +18,22 @@ const {
|
|||
} = getFileLoaderUtils();
|
||||
|
||||
const createJSX = (node, pathUrl) => {
|
||||
node.type = 'jsx';
|
||||
node.value = `<img ${node.alt ? `alt={"${escapeHtml(node.alt)}"} ` : ''}${
|
||||
const jsxNode = node;
|
||||
jsxNode.type = 'jsx';
|
||||
jsxNode.value = `<img ${node.alt ? `alt={"${escapeHtml(node.alt)}"} ` : ''}${
|
||||
node.url
|
||||
? `src={require("${inlineMarkdownImageFileLoader}${pathUrl}").default}`
|
||||
: ''
|
||||
}${node.title ? ` title="${escapeHtml(node.title)}"` : ''} />`;
|
||||
|
||||
if (node.url) {
|
||||
delete node.url;
|
||||
if (jsxNode.url) {
|
||||
delete jsxNode.url;
|
||||
}
|
||||
if (node.alt) {
|
||||
delete node.alt;
|
||||
if (jsxNode.alt) {
|
||||
delete jsxNode.alt;
|
||||
}
|
||||
if (node.title) {
|
||||
delete node.title;
|
||||
if (jsxNode.title) {
|
||||
delete jsxNode.title;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue