mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
parent
fcd65cc862
commit
6e8b0229b8
|
@ -76,8 +76,8 @@ class MarkdownPreviewConfig {
|
||||||
this.markEditorSelection = !!markdownConfig.get<boolean>('preview.markEditorSelection', true);
|
this.markEditorSelection = !!markdownConfig.get<boolean>('preview.markEditorSelection', true);
|
||||||
|
|
||||||
this.fontFamily = markdownConfig.get<string | undefined>('preview.fontFamily', undefined);
|
this.fontFamily = markdownConfig.get<string | undefined>('preview.fontFamily', undefined);
|
||||||
this.fontSize = +markdownConfig.get<number>('preview.fontSize', NaN);
|
this.fontSize = Math.max(8, +markdownConfig.get<number>('preview.fontSize', NaN));
|
||||||
this.lineHeight = +markdownConfig.get<number>('preview.lineHeight', NaN);
|
this.lineHeight = Math.max(0.6, +markdownConfig.get<number>('preview.lineHeight', NaN));
|
||||||
|
|
||||||
this.styles = markdownConfig.get<string[]>('styles', []);
|
this.styles = markdownConfig.get<string[]>('styles', []);
|
||||||
}
|
}
|
||||||
|
@ -176,8 +176,8 @@ export class MDDocumentContentProvider implements vscode.TextDocumentContentProv
|
||||||
return `<style nonce="${nonce}">
|
return `<style nonce="${nonce}">
|
||||||
body {
|
body {
|
||||||
${this.config.fontFamily ? `font-family: ${this.config.fontFamily};` : ''}
|
${this.config.fontFamily ? `font-family: ${this.config.fontFamily};` : ''}
|
||||||
${this.config.fontSize > 0 ? `font-size: ${this.config.fontSize}px;` : ''}
|
${isNaN(this.config.fontSize) ? '' : `font-size: ${this.config.fontSize}px;`}
|
||||||
${this.config.lineHeight > 0 ? `line-height: ${this.config.lineHeight};` : ''}
|
${isNaN(this.config.lineHeight) ? '' : `line-height: ${this.config.lineHeight};`}
|
||||||
}
|
}
|
||||||
</style>`;
|
</style>`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue