diff --git a/app/routes/posts/md_test.mdx b/app/routes/posts/md_test.mdx index 2fe32ee..5d5f86e 100644 --- a/app/routes/posts/md_test.mdx +++ b/app/routes/posts/md_test.mdx @@ -5,7 +5,8 @@ publishedAt: "2024-09-XX" # # Section1 -これはMarkdownの試し打ちです。適宜チューニングしていきたい。以下、怪文書が続きます。 +これはMarkdownの試し打ちです。適宜チューニングしていきたい。 +以下、怪文書が続きます。 ## ## Section 2 diff --git a/package.json b/package.json index 72e3afa..f7fc01a 100644 --- a/package.json +++ b/package.json @@ -23,18 +23,19 @@ "@hono/vite-dev-server": "^0.14.0", "@hono/vite-ssg": "^0.1.0", "@mdx-js/rollup": "^3.0.1", - "lint-staged": "^15.2.7", "@types/hast": "^3.0.4", "@types/mdast": "^4.0.4", "@types/unist": "^3.0.3", "hast": "^1.0.0", "hast-util-to-html": "^9.0.2", "husky": "^9.1.1", + "lint-staged": "^15.2.7", "mdast": "^3.0.0", + "rehype-parse": "^9.0.0", + "remark-breaks": "^4.0.0", "remark-frontmatter": "^5.0.0", "remark-gfm": "^4.0.0", "remark-mdx-frontmatter": "^5.0.0", - "rehype-parse": "^9.0.0", "shiki": "^1.16.2", "unified": "^11.0.5", "unist": "^0.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ca84c7c..dac04b8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,6 +60,9 @@ importers: rehype-parse: specifier: ^9.0.0 version: 9.0.0 + remark-breaks: + specifier: ^4.0.0 + version: 4.0.0 remark-frontmatter: specifier: ^5.0.0 version: 5.0.0 @@ -1357,6 +1360,9 @@ packages: mdast-util-mdxjs-esm@2.0.1: resolution: {integrity: sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==} + mdast-util-newline-to-break@2.0.0: + resolution: {integrity: sha512-MbgeFca0hLYIEx/2zGsszCSEJJ1JSCdiY5xQxRcLDDGa8EPvlLPupJ4DSajbMPAnC0je8jfb9TiUATnxxrHUog==} + mdast-util-phrasing@4.1.0: resolution: {integrity: sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==} @@ -1642,6 +1648,9 @@ packages: rehype-parse@9.0.0: resolution: {integrity: sha512-WG7nfvmWWkCR++KEkZevZb/uw41E8TsH4DsY9UxsTbIXCVGbAs4S+r8FrQ+OtH5EEQAs+5UxKC42VinkmpA1Yw==} + remark-breaks@4.0.0: + resolution: {integrity: sha512-IjEjJOkH4FuJvHZVIW0QCDWxcG96kCq7An/KVH2NfJe6rKZU2AsHeB3OEjPNRxi4QC34Xdx7I2KGYn6IpT7gxQ==} + remark-frontmatter@5.0.0: resolution: {integrity: sha512-XTFYvNASMe5iPN0719nPrdItC9aU0ssC4v14mH1BCi1u0n1gAocqcujWUrByftZTbLhRtiKRyjYTSIOcr69UVQ==} @@ -3268,6 +3277,11 @@ snapshots: transitivePeerDependencies: - supports-color + mdast-util-newline-to-break@2.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-find-and-replace: 3.0.1 + mdast-util-phrasing@4.1.0: dependencies: '@types/mdast': 4.0.4 @@ -3755,6 +3769,12 @@ snapshots: hast-util-from-html: 2.0.2 unified: 11.0.5 + remark-breaks@4.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-newline-to-break: 2.0.0 + unified: 11.0.5 + remark-frontmatter@5.0.0: dependencies: '@types/mdast': 4.0.4 diff --git a/vite.config.ts b/vite.config.ts index 860ff22..2d76de4 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,6 +4,7 @@ import honox from 'honox/vite' import { defineConfig } from 'vite' import ssg from '@hono/vite-ssg' import mdx from '@mdx-js/rollup'; +import remarkBreaks from 'remark-breaks'; import remarkFrontmatter from 'remark-frontmatter'; import remarkMdxFrontmatter from 'remark-mdx-frontmatter'; import remarkGfm from 'remark-gfm' @@ -21,7 +22,7 @@ export default defineConfig(() => { ssg({ entry: "./app/server.ts" }), mdx({ jsxImportSource: 'hono/jsx', - remarkPlugins: [remarkGfm, remarkFrontmatter, remarkMdxFrontmatter, remarkMomijiCodeFilename], + remarkPlugins: [remarkGfm, remarkBreaks, remarkFrontmatter, remarkMdxFrontmatter, remarkMomijiCodeFilename], rehypePlugins: [rehypeMomiji] }) ],