Skip to content

Commit df69da2

Browse files
authored
feat(astro): preserve file path for imported file code blocks (#446)
1 parent d586225 commit df69da2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/astro/src/remark/import-file.ts

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export function remarkImportFilePlugin(options: RemarkImportFilePluginOptions) {
4848

4949
if (content) {
5050
node.value = content;
51+
node.meta ||= '';
52+
node.meta += ' path=' + node.lang;
5153
node.lang = path.extname(relativeFilePath).slice(1);
5254
}
5355
}

0 commit comments

Comments
 (0)