fix: remove block comments containing closing delimiter causing babel parse errors
Build and Deploy Verso / deploy (push) Successful in 15m19s
Build and Deploy Verso / deploy (push) Successful in 15m19s
JSDoc blocks in typst-decorations.ts and quarto-decorations.ts contained */ sequences inside them, which Babel's parser treats as terminating the block comment prematurely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
-14
@@ -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<string, string> = {
|
||||
ATXHeading1: '1',
|
||||
ATXHeading2: '2',
|
||||
@@ -31,15 +26,6 @@ const ATX_HEADING_LEVEL: Record<string, string> = {
|
||||
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 = (
|
||||
|
||||
-11
@@ -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 = (
|
||||
|
||||
Reference in New Issue
Block a user