mirror of
https://github.com/immich-app/static-pages.git
synced 2026-09-30 21:27:54 +08:00
fix: markdown render issues (#832)
This commit is contained in:
@@ -139,6 +139,12 @@ describe(svelteMarkdownPreprocess.name, () => {
|
||||
it('should leave a component inside a code fence as code', async () => {
|
||||
await expect(render('```svelte\n<Markdown.Image src="a.webp" />\n```')).resolves.toContain('<Markdown.Code');
|
||||
});
|
||||
|
||||
it('should escape template syntax inside inline code', async () => {
|
||||
await expect(render('Use `${PORT}:{PORT}`')).resolves.toContain(
|
||||
'<Markdown.Code code={`' + String.raw`$\{PORT\}:\{PORT\}` + '`} />',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('images', () => {
|
||||
|
||||
@@ -227,7 +227,7 @@ export const markedSvelte = (): MarkedExtension => ({
|
||||
},
|
||||
|
||||
codespan({ text }) {
|
||||
return `<Markdown.Code code={\`${text}\`} />`;
|
||||
return `<Markdown.Code code={\`${escapeSvelteCode(text)}\`} />`;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user