@simple-mark/codemirror 0.3.2 → 0.3.3
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.
- package/index.js +5 -2
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -252,10 +252,12 @@ var MarkdownDecorations = class {
|
|
|
252
252
|
let deco = this.cache.get(key);
|
|
253
253
|
if (!deco) {
|
|
254
254
|
const linked = styles.includes("link") || styles.includes("url");
|
|
255
|
+
const look = resolveLook([], styles, this.theme);
|
|
256
|
+
const keepLine = look.monospace !== void 0 || look.fontScale !== void 0;
|
|
255
257
|
deco = Decoration.mark({
|
|
256
258
|
class: styles.map((s) => `sm-${s}`).join(" "),
|
|
257
259
|
attributes: {
|
|
258
|
-
style: lookCss(
|
|
260
|
+
style: lookCss(look, this.theme) + (keepLine ? "; line-height: 0" : ""),
|
|
259
261
|
...linked ? { title: `${followKeyName}+Click to open` } : {}
|
|
260
262
|
}
|
|
261
263
|
});
|
|
@@ -620,9 +622,10 @@ const heightHints = StateField.define({
|
|
|
620
622
|
},
|
|
621
623
|
provide: (field) => EditorView.decorations.from(field)
|
|
622
624
|
});
|
|
625
|
+
const hintTheme = EditorView.baseTheme({ ".sm-height-hint + .cm-widgetBuffer": { verticalAlign: "top" } });
|
|
623
626
|
/** Better height estimates for headings and wrapping lines that are not drawn yet. */
|
|
624
627
|
function lineHeightHints() {
|
|
625
|
-
return heightHints;
|
|
628
|
+
return [heightHints, hintTheme];
|
|
626
629
|
}
|
|
627
630
|
//#endregion
|
|
628
631
|
//#region packages/codemirror/src/previews.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simple-mark/codemirror",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "CodeMirror 6 editor that styles Markdown without hiding its syntax.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@codemirror/state": "^6.7.6",
|
|
29
29
|
"@codemirror/view": "^6.43.15",
|
|
30
30
|
"@lezer/common": "^1.5.3",
|
|
31
|
-
"@simple-mark/math": "^0.3.
|
|
32
|
-
"@simple-mark/model": "^0.3.
|
|
31
|
+
"@simple-mark/math": "^0.3.3",
|
|
32
|
+
"@simple-mark/model": "^0.3.3"
|
|
33
33
|
}
|
|
34
34
|
}
|