1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-09-16 19:45:33 -04:00

use smartypants remark plugin for fancy quotes, etc.

This commit is contained in:
2022-05-12 15:02:27 -04:00
parent a624a8c30f
commit a97eb0532f
4 changed files with 132 additions and 19 deletions

View File

@@ -16,6 +16,8 @@ import { NOTES_DIR } from "../config/constants";
// remark/rehype markdown plugins
import remarkGfm from "remark-gfm";
import remarkSmartypants from "remark-smartypants";
import remarkUnwrapImages from "remark-unwrap-images";
import rehypeSlug from "rehype-slug";
import rehypePrism from "rehype-prism-plus";
@@ -79,7 +81,19 @@ export const getNote = async (slug: string): Promise<Note> => {
const source = await serialize(content, {
parseFrontmatter: false,
mdxOptions: {
remarkPlugins: [[remarkGfm, { singleTilde: false }]],
remarkPlugins: [
[remarkGfm, { singleTilde: false }],
[
remarkSmartypants,
{
quotes: true,
dashes: "oldschool",
backticks: false,
ellipses: false,
},
],
[remarkUnwrapImages],
],
rehypePlugins: [[rehypeSlug], [rehypePrism, { ignoreMissing: true }]],
},
});