Compare commits

...
Sign in to create a new pull request.
Author SHA1 Message Date
5237aca552
Added [[type: <text>]] Markdown extension for future use.
Currently this is only for adding inline quotations (.e.g the
[text](:quote) markup), but I need to think a little about how to
structure the actual HTML markup for this.
2026-07-18 13:20:22 -06:00
2 changed files with 18 additions and 1 deletions

View file

@ -4,6 +4,7 @@ import mdx from '@astrojs/mdx';
import tailwindcss from "@tailwindcss/vite";
import { unified } from '@astrojs/markdown-remark';
import { ScriptureLinks } from './src/utils/rehype';
import { ScriptureMark } from './src/utils/remark';
// https://astro.build/config
export default defineConfig({
@ -14,6 +15,7 @@ export default defineConfig({
markdown: {
processor: unified({
rehypePlugins: [ScriptureLinks],
remarkPlugins: [ScriptureMark],
}),
},
vite: {

View file

@ -20,4 +20,19 @@ export const ScriptureLinks = () => {
}
});
};
};
};
export const ScriptureMark = () => {
return async tree => {
visit(tree, 'text', (node, index, parent) => {
if (node.value.includes('[[quote:')) {
const text = node.value.substring(8, node.value.length-2);
const newNode = {
type: 'html',
value: `<span class="quote">${text}</span>`,
};
parent.children[index] = newNode;
}
});
};
}