remark-inline-svg-flex 0.2.3 → 0.3.3

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.
Files changed (2) hide show
  1. package/README.md +9 -4
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -61,16 +61,21 @@ This is a test markdown document.
61
61
  ![some svg](some.svg)
62
62
  ```
63
63
 
64
- And our module `example.js` looks as follows:
64
+ And our module `example.js` looks as the one below. It is recommended to pass
65
+ the markdown directory path to `process()` so that the plugin can resolve relative
66
+ paths correctly.
65
67
 
66
68
  ```js
67
69
  import { remark } from 'remark';
68
70
  import { readFile } from 'node:fs/promises';
69
- import { inlineSvg } from 'remark-inline-svg-flex';
71
+ import { remarkInlineSvg } from 'remark-inline-svg-flex';
70
72
 
71
73
  const markdown = await readFile(_path, { encoding: 'utf8' });
72
74
 
73
- return await remark().use(remarkParse).use(inlineSvg).process(markdown);
75
+ return await remark()
76
+ .use(remarkParse)
77
+ .use(remarkInlineSvg)
78
+ .process({ value: markdown, path: _path });
74
79
  ```
75
80
 
76
81
  Now running `node example.js` yields:
@@ -120,5 +125,5 @@ The SVG's are optimized by default. Disable it by setting it to `false`.
120
125
  ## SVGO configuration
121
126
 
122
127
  ```
123
- { plugins: ['preset-default', 'removeXMLNS', 'removeDimensions'] }
128
+ { plugins: ['preset-default', 'removeXMLNS'] }
124
129
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remark-inline-svg-flex",
3
- "version": "0.2.3",
3
+ "version": "0.3.3",
4
4
  "description": "Flexible Remark plugin that inlines and optimizes SVGs with SVGO, featuring customizable path resolution and wrappers.",
5
5
  "keywords": [
6
6
  "unified",
@@ -48,11 +48,11 @@
48
48
  "rimraf": "^6.1.3",
49
49
  "typescript": "^5.9.3",
50
50
  "unified": "^11.0.5",
51
- "vfile": "^6.0.3",
52
51
  "vitest": "^4.1.0"
53
52
  },
54
53
  "dependencies": {
55
54
  "svgo": "^4.0.1",
56
- "unist-util-visit": "^5.1.0"
55
+ "unist-util-visit": "^5.1.0",
56
+ "vfile": "^6.0.3"
57
57
  }
58
58
  }