diff --git a/services/web/frontend/js/features/source-editor/extensions/visual/quarto-decorations.ts b/services/web/frontend/js/features/source-editor/extensions/visual/quarto-decorations.ts index 464fe55e1e..d7f4544a15 100644 --- a/services/web/frontend/js/features/source-editor/extensions/visual/quarto-decorations.ts +++ b/services/web/frontend/js/features/source-editor/extensions/visual/quarto-decorations.ts @@ -9,10 +9,6 @@ import { syntaxTree } from '@codemirror/language' import { Tree } from '@lezer/common' import { selectionIntersects } from './selection' -/** - * Returns true when the node range should have its markers hidden: - * either the document is read-only, or the cursor is not inside the node. - */ function shouldDecorate( state: EditorState, from: number, @@ -21,7 +17,6 @@ function shouldDecorate( return state.readOnly || !selectionIntersects(state.selection, { from, to }) } -// ATX heading node names → heading level string const ATX_HEADING_LEVEL: Record = { ATXHeading1: '1', ATXHeading2: '2', @@ -31,15 +26,6 @@ const ATX_HEADING_LEVEL: Record = { ATXHeading6: '6', } -/** - * Visual-mode decorations for Quarto/Markdown documents (.qmd, .md). - * - * Hides syntactic markers (#/*/_ etc.) when the cursor is outside them and - * applies CSS classes for headings, bold, italic, strikethrough, and inline - * code. Mirrors the pattern used by typstDecorations for Typst files. - * - * Only covers ATX headings (# … ####### …) — Setext headings are skipped. - */ export const quartoDecorations = ViewPlugin.define( view => { const createDecorations = ( diff --git a/services/web/frontend/js/features/source-editor/extensions/visual/typst-decorations.ts b/services/web/frontend/js/features/source-editor/extensions/visual/typst-decorations.ts index 9fe9476664..fbedb25cbe 100644 --- a/services/web/frontend/js/features/source-editor/extensions/visual/typst-decorations.ts +++ b/services/web/frontend/js/features/source-editor/extensions/visual/typst-decorations.ts @@ -9,10 +9,6 @@ import { syntaxTree } from '@codemirror/language' import { Tree } from '@lezer/common' import { selectionIntersects } from './selection' -/** - * Returns true when the node range should have its markers hidden: - * either the document is read-only, or the cursor is not inside the node. - */ function shouldDecorate( state: EditorState, from: number, @@ -21,13 +17,6 @@ function shouldDecorate( return state.readOnly || !selectionIntersects(state.selection, { from, to }) } -/** - * Visual-mode decorations for Typst markup. - * - * Hides syntactic markers (*/_/= headings/backticks) when the cursor is - * outside them, and applies CSS classes for bold, italic, headings, and - * inline code. Mirrors the pattern used by markDecorations for LaTeX. - */ export const typstDecorations = ViewPlugin.define( view => { const createDecorations = (