summaryrefslogtreecommitdiff
path: root/packages/markdown/remark/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/markdown/remark/src')
-rw-r--r--packages/markdown/remark/src/index.ts6
-rw-r--r--packages/markdown/remark/src/ssr-utils.ts8
2 files changed, 8 insertions, 6 deletions
diff --git a/packages/markdown/remark/src/index.ts b/packages/markdown/remark/src/index.ts
index 817174e4c..9dfc0e38c 100644
--- a/packages/markdown/remark/src/index.ts
+++ b/packages/markdown/remark/src/index.ts
@@ -13,7 +13,6 @@ import scopedStyles from './remark-scoped-styles.js';
import remarkShiki from './remark-shiki.js';
import remarkUnwrap from './remark-unwrap.js';
-import Slugger from 'github-slugger';
import rehypeRaw from 'rehype-raw';
import rehypeStringify from 'rehype-stringify';
import markdown from 'remark-parse';
@@ -26,11 +25,6 @@ export * from './types.js';
export const DEFAULT_REMARK_PLUGINS = ['remark-gfm', 'remark-smartypants'];
export const DEFAULT_REHYPE_PLUGINS = [];
-const slugger = new Slugger();
-export function slug(value: string): string {
- return slugger.slug(value);
-}
-
/** Shared utility for rendering markdown */
export async function renderMarkdown(
content: string,
diff --git a/packages/markdown/remark/src/ssr-utils.ts b/packages/markdown/remark/src/ssr-utils.ts
new file mode 100644
index 000000000..1491e24a5
--- /dev/null
+++ b/packages/markdown/remark/src/ssr-utils.ts
@@ -0,0 +1,8 @@
+/** Utilities used in deployment-ready SSR bundles */
+import Slugger from 'github-slugger';
+
+const slugger = new Slugger();
+/** @see {@link "/packages/astro/vite-plugin-markdown"} */
+export function slug(value: string): string {
+ return slugger.slug(value);
+}