@astrojs/markdown-remark 7.0.1 → 7.1.0
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.
- package/dist/index.js +3 -2
- package/dist/types.d.ts +3 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -64,8 +64,9 @@ async function createMarkdownProcessor(opts) {
|
|
|
64
64
|
if (gfm) {
|
|
65
65
|
parser.use(remarkGfm);
|
|
66
66
|
}
|
|
67
|
-
if (smartypants) {
|
|
68
|
-
|
|
67
|
+
if (smartypants !== false) {
|
|
68
|
+
const smartypantsConfig = typeof smartypants === "object" ? smartypants : {};
|
|
69
|
+
parser.use(remarkSmartypants, smartypantsConfig);
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
for (const [plugin, pluginOpts] of loadedRemarkPlugins) {
|
package/dist/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { RemotePattern } from '@astrojs/internal-helpers/remote';
|
|
|
2
2
|
import type * as hast from 'hast';
|
|
3
3
|
import type * as mdast from 'mdast';
|
|
4
4
|
import type { Options as RemarkRehypeOptions } from 'remark-rehype';
|
|
5
|
+
import type { Options as SmartypantsOptions } from 'retext-smartypants';
|
|
5
6
|
import type { BuiltinTheme } from 'shiki';
|
|
6
7
|
import type * as unified from 'unified';
|
|
7
8
|
import type { CreateShikiHighlighterOptions, ShikiHighlighterHighlightOptions } from './shiki.js';
|
|
@@ -21,6 +22,7 @@ export type RemarkPlugins = (string | [string, any] | RemarkPlugin | [RemarkPlug
|
|
|
21
22
|
export type RehypePlugin<PluginParameters extends any[] = any[]> = unified.Plugin<PluginParameters, hast.Root>;
|
|
22
23
|
export type RehypePlugins = (string | [string, any] | RehypePlugin | [RehypePlugin, any])[];
|
|
23
24
|
export type RemarkRehype = RemarkRehypeOptions;
|
|
25
|
+
export type Smartypants = SmartypantsOptions;
|
|
24
26
|
export type ThemePresets = BuiltinTheme | 'css-variables';
|
|
25
27
|
export type SyntaxHighlightConfigType = 'shiki' | 'prism';
|
|
26
28
|
export interface SyntaxHighlightConfig {
|
|
@@ -39,7 +41,7 @@ export interface AstroMarkdownOptions {
|
|
|
39
41
|
rehypePlugins?: RehypePlugins;
|
|
40
42
|
remarkRehype?: RemarkRehype;
|
|
41
43
|
gfm?: boolean;
|
|
42
|
-
smartypants?: boolean;
|
|
44
|
+
smartypants?: boolean | SmartypantsOptions;
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
45
47
|
* Extra configuration options from other parts of AstroConfig that get injected into this plugin
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/markdown-remark",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "withastro",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"remark-parse": "^11.0.0",
|
|
42
42
|
"remark-rehype": "^11.1.2",
|
|
43
43
|
"remark-smartypants": "^3.0.2",
|
|
44
|
+
"retext-smartypants": "^6.2.0",
|
|
44
45
|
"shiki": "^4.0.0",
|
|
45
46
|
"smol-toml": "^1.6.0",
|
|
46
47
|
"unified": "^11.0.5",
|