mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-03-13 01:47:24 +00:00
19 lines
486 B
JavaScript
19 lines
486 B
JavaScript
import matter from 'gray-matter';
|
|
|
|
const disabledFrontmatterEngine = () => ({});
|
|
|
|
const frontmatterOptions = {
|
|
language: 'yaml',
|
|
// Disable JS/JSON frontmatter parsing to avoid executable project content.
|
|
// Mirrors Gatsby's mitigation for gray-matter.
|
|
engines: {
|
|
js: disabledFrontmatterEngine,
|
|
javascript: disabledFrontmatterEngine,
|
|
json: disabledFrontmatterEngine
|
|
}
|
|
};
|
|
|
|
export function parseFrontmatter(content) {
|
|
return matter(content, frontmatterOptions);
|
|
}
|