@seafile/sdoc-editor 0.1.158 → 0.1.159

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -132,9 +132,7 @@ export var loadFont = function loadFont() {
132
132
  fontLink.className = GOOGLE_FONT_CLASS;
133
133
  document.body.appendChild(fontLink);
134
134
  };
135
- export var generatorFontFamily = function generatorFontFamily(fontName, fontWeight, leaf) {
136
- var isCodeBlock = leaf && Object.keys(leaf).includes('token');
137
- if (isCodeBlock) return '';
135
+ export var generatorFontFamily = function generatorFontFamily(fontName, fontWeight) {
138
136
  var lang = context.getSetting('lang') || 'zh-cn';
139
137
  if (fontName === DEFAULT_FONT) {
140
138
  return "'Arial', ".concat(lang === 'zh-cn' ? "\u5B8B\u4F53" : 'Arial', ", 'sans-serif'");
@@ -32,9 +32,10 @@ var renderText = function renderText(props, editor) {
32
32
  style['fontSize'] = "".concat(fontSize, "pt");
33
33
  }
34
34
  }
35
- var font = leaf[TEXT_STYLE_MAP.FONT] || DEFAULT_FONT;
36
- var fontWeight = leaf[TEXT_STYLE_MAP.BOLD] ? 600 : 400;
37
- style['fontFamily'] = generatorFontFamily(font, fontWeight, leaf);
35
+ if (leaf[TEXT_STYLE_MAP.FONT]) {
36
+ var fontWeight = leaf[TEXT_STYLE_MAP.BOLD] ? 600 : 400;
37
+ style['fontFamily'] = generatorFontFamily(leaf[TEXT_STYLE_MAP.FONT], fontWeight);
38
+ }
38
39
  if (leaf[TEXT_STYLE_MAP.BOLD]) {
39
40
  markedChildren = /*#__PURE__*/React.createElement("strong", null, markedChildren);
40
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "0.1.158",
3
+ "version": "0.1.159",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",