mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
Add katex style to root of notebook
Fixes #128490 This is needed to ensure the katex font-face is loaded properly Seems like this is needed to work around a bug: https://bugs.chromium.org/p/chromium/issues/detail?id=336876
This commit is contained in:
parent
fd48df6c7f
commit
b2142b93e0
|
@ -14,11 +14,21 @@ export async function activate(ctx: {
|
|||
throw new Error('Could not load markdownItRenderer');
|
||||
}
|
||||
|
||||
// Add katex styles to be copied to shadow dom
|
||||
const link = document.createElement('link');
|
||||
link.rel = 'stylesheet';
|
||||
link.classList.add('markdown-style');
|
||||
link.href = styleHref;
|
||||
|
||||
// Add same katex style to root document.
|
||||
// This is needed for the font to be loaded correctly inside the shadow dom.
|
||||
//
|
||||
// Seems like https://bugs.chromium.org/p/chromium/issues/detail?id=336876
|
||||
const linkHead = document.createElement('link');
|
||||
linkHead.rel = 'stylesheet';
|
||||
linkHead.href = styleHref;
|
||||
document.head.appendChild(linkHead);
|
||||
|
||||
const style = document.createElement('style');
|
||||
style.textContent = `
|
||||
.katex-error {
|
||||
|
|
Loading…
Reference in a new issue