mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-15 18:46:36 -05:00
fixed css for font family (#15119)
This commit is contained in:
@@ -808,7 +808,23 @@ export class ViewModel extends Disposable implements IViewModel {
|
||||
|
||||
const fontInfo = this._configuration.options.get(EditorOption.fontInfo);
|
||||
const colorMap = this._getColorMap();
|
||||
const fontFamily = fontInfo.fontFamily === EDITOR_FONT_DEFAULTS.fontFamily ? fontInfo.fontFamily : `'${fontInfo.fontFamily}', ${EDITOR_FONT_DEFAULTS.fontFamily}`;
|
||||
const hasBadChars = (/[:;\\\/<>]/.test(fontInfo.fontFamily));
|
||||
const useDefaultFontFamily = (hasBadChars || fontInfo.fontFamily === EDITOR_FONT_DEFAULTS.fontFamily);
|
||||
let fontFamily: string;
|
||||
if (useDefaultFontFamily) {
|
||||
fontFamily = EDITOR_FONT_DEFAULTS.fontFamily;
|
||||
} else {
|
||||
fontFamily = fontInfo.fontFamily;
|
||||
fontFamily = fontFamily.replace(/"/g, '\'');
|
||||
const hasQuotesOrIsList = /[,']/.test(fontFamily);
|
||||
if (!hasQuotesOrIsList) {
|
||||
const needsQuotes = /[+ ]/.test(fontFamily);
|
||||
if (needsQuotes) {
|
||||
fontFamily = `'${fontFamily}'`;
|
||||
}
|
||||
}
|
||||
fontFamily = `${fontFamily}, ${EDITOR_FONT_DEFAULTS.fontFamily}`;
|
||||
}
|
||||
|
||||
return {
|
||||
mode: languageId.language,
|
||||
|
||||
Reference in New Issue
Block a user