mrmd-editor 0.4.0 → 0.5.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mrmd-editor",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Markdown editor with realtime collaboration - the core editor package",
5
5
  "type": "module",
6
6
  "main": "dist/mrmd.cjs",
@@ -60,7 +60,7 @@
60
60
  "codemirror-lang-mermaid": "^0.3.0",
61
61
  "codemirror-lang-r": "^0.1.1",
62
62
  "katex": "^0.16.27",
63
- "mrmd-js": "^2.1.0",
63
+ "mrmd-js": "^2.2.0",
64
64
  "y-codemirror.next": "^0.3.5",
65
65
  "y-websocket": "^2.0.0",
66
66
  "yaml": "^2.8.2",
package/src/cells.js CHANGED
@@ -24,6 +24,8 @@ const EXECUTABLE_LANGUAGES = new Set([
24
24
  'html',
25
25
  // CSS (applied to page)
26
26
  'css',
27
+ // Mermaid diagrams (rendered to SVG)
28
+ 'mermaid',
27
29
  ]);
28
30
 
29
31
  /**
@@ -1381,6 +1381,7 @@ export const outputWidgetStyles = `
1381
1381
  /* HTML Output Widget - renders HTML in sandboxed iframe */
1382
1382
  .cm-html-output-widget {
1383
1383
  position: relative;
1384
+ z-index: 5;
1384
1385
  margin: 8px 0;
1385
1386
  padding: 0;
1386
1387
  background: var(--widget-surface, rgba(0, 0, 0, 0.35));
@@ -21,6 +21,14 @@ import { Facet } from '@codemirror/state';
21
21
  import { autocompletion, CompletionContext } from '@codemirror/autocomplete';
22
22
  import { syntaxTree } from '@codemirror/language';
23
23
 
24
+ const DOC_EXTENSIONS = ['.md', '.qmd'];
25
+
26
+ function isDocFile(path) {
27
+ if (!path) return false;
28
+ const lower = path.toLowerCase();
29
+ return DOC_EXTENSIONS.some(ext => lower.endsWith(ext));
30
+ }
31
+
24
32
  // #region FACET
25
33
 
26
34
  /**
@@ -190,7 +198,7 @@ export function createWikiLinkCompletionSource() {
190
198
 
191
199
  for (const file of files) {
192
200
  // Skip non-markdown or special files
193
- if (!file.path.endsWith('.md')) continue;
201
+ if (!isDocFile(file.path)) continue;
194
202
  if (file.path === 'mrmd.md') continue;
195
203
  if (file.name === 'index') continue; // Skip index files, use folder name instead
196
204