You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(markdown/remark): Smartypants config
* feat(astro): Smartypants config
* test: add e2e Smartypants config tests
* docs: add changesets
* docs: update public Astro config types docs
this file is used to autogenerate the configuration reference documentation
* fix: unused import
* feat: change docs version
* feat: set since version in config to 6.1.0
* fix: adapt default type definition
* refactor: use retext-smartypants options
* fix: remove export of Smartypants type from astro core
* fix: reexport Smartypants type but lintignore it
* Update packages/astro/src/types/public/config.ts
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
---------
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
Updates `createMarkdownProcessor` to support advanced SmartyPants options.
6
+
7
+
The `smartypants` property in `AstroMarkdownOptions` now accepts `Smartypants` options, allowing fine-grained control over typography transformations (backticks, dashes, ellipses, and quotes).
For the up-to-date supported properties, check out [the `retext-smartypants` options](https://github.com/retextjs/retext-smartypants?tab=readme-ov-file#fields).
Adds support for advanced configuration of SmartyPants in Markdown.
6
+
7
+
You can now pass an options object to `markdown.smartypants` in your Astro configuration to fine-tune how punctuation, dashes, and quotes are transformed.
8
+
9
+
This is helpful for projects that require specific typographic standards, such as "oldschool" dash handling or localized quotation marks.
10
+
11
+
```js
12
+
// astro.config.mjs
13
+
exportdefaultdefineConfig({
14
+
markdown: {
15
+
smartypants: {
16
+
backticks:'all',
17
+
dashes:'oldschool',
18
+
ellipses:'unspaced',
19
+
openingQuotes: { double:'«', single:'‹' },
20
+
closingQuotes: { double:'»', single:'›' },
21
+
quotes:false,
22
+
},
23
+
},
24
+
});
25
+
```
26
+
27
+
See [the `retext-smartypants` options](https://github.com/retextjs/retext-smartypants?tab=readme-ov-file#fields) for more information.
* Astro uses the [SmartyPants formatter](https://daringfireball.net/projects/smartypants/) by default. To disable this, set the `smartypants` flag to `false`:
2119
+
* Whether to use the [SmartyPants formatter](https://daringfireball.net/projects/smartypants/) to transform straight quotes into smart quotes, dashes into en/em dashes, and triple dots into ellipses.
2118
2120
*
2119
-
* ```js
2120
-
* {
2121
-
* markdown: {
2122
-
* smartypants: false,
2123
-
* }
2124
-
* }
2125
-
* ```
2121
+
* To disable this, set the `smartypants` flag to `false`.
2122
+
*
2123
+
* For more control over typography, you can instead specify a configuration object with the [properties supported by `retext-smartypants`](https://github.com/retextjs/retext-smartypants?tab=readme-ov-file#fields).
0 commit comments