Skip to content

scanHtmlIncludes

scanHtmlIncludes(content, file): IncludeDirective[]

Defined in: preprocess/include/scan-html.ts:79

Scan HTML content for include directives

string

HTML file content

string

Canonical path of the file being scanned

IncludeDirective[]

Array of include directives in encounter order

const content = `
<body>
<section data-include="./intro.md" data-include-format="markdown"></section>
</body>
`;
const includes = scanHtmlIncludes(content, '/spec/format.html');
// Returns: [{ relativePath: './intro.md', format: 'markdown', ... }]