@alauda/doom 1.10.5 → 1.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,15 @@
1
1
  import { directiveToMarkdown } from 'mdast-util-directive';
2
2
  import { toMarkdown } from 'mdast-util-to-markdown';
3
3
  import { visit } from 'unist-util-visit';
4
+ const CONTAINER_DIRECTIVE_TYPES = new Set([
5
+ 'tip',
6
+ 'note',
7
+ 'warning',
8
+ 'caution',
9
+ 'danger',
10
+ 'info',
11
+ 'details',
12
+ ]);
4
13
  export const remarkDirectives = function () {
5
14
  return (root) => {
6
15
  visit(root, (node, index, parent) => {
@@ -10,6 +19,15 @@ export const remarkDirectives = function () {
10
19
  return;
11
20
  }
12
21
  const data = node.data || (node.data = {});
22
+ if (node.type === 'containerDirective' &&
23
+ (CONTAINER_DIRECTIVE_TYPES.has(node.name) ||
24
+ // https://github.com/web-infra-dev/rspress/pull/2403
25
+ (!node.name &&
26
+ data.hProperties?.class
27
+ ?.toString()
28
+ .startsWith('rspress-directive')))) {
29
+ return;
30
+ }
13
31
  switch (node.name) {
14
32
  case 'callouts': {
15
33
  data.hProperties = { className: 'doom-callouts' };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alauda/doom",
3
- "version": "1.10.5",
3
+ "version": "1.10.6",
4
4
  "type": "module",
5
5
  "description": "Doctor Doom making docs.",
6
6
  "repository": "git+https://github.com/alauda/doom.git",