|
|
@@ -2,7 +2,7 @@ import { Schema as SanitizeOption } from 'hast-util-sanitize';
|
|
|
import { Plugin } from 'unified';
|
|
|
import { visit } from 'unist-util-visit';
|
|
|
|
|
|
-const SUPPORTED_ATTRIBUTES = ['attachmentId'];
|
|
|
+const SUPPORTED_ATTRIBUTES = ['attachmentId', 'url', 'attachmentName'];
|
|
|
|
|
|
const isAttachmentLink = (url: string) => {
|
|
|
// https://regex101.com/r/9qZhiK/1
|
|
|
@@ -21,6 +21,8 @@ export const remarkPlugin: Plugin = () => {
|
|
|
data.hName = 'attachment';
|
|
|
data.hProperties = {
|
|
|
attachmentId: pathName[2],
|
|
|
+ url: node.url,
|
|
|
+ attachmentName: node.children[0].value,
|
|
|
};
|
|
|
|
|
|
// omit position to fix the key regardless of its position
|