Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/web/src/components/live-markdown/math.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { afterEach, describe, expect, it } from 'vitest';
import { EditorState, StateField } from '@codemirror/state';
import { Decoration, type DecorationSet, EditorView } from '@codemirror/view';
import { markdown, markdownLanguage } from '@codemirror/lang-markdown';
import { ensureSyntaxTree } from '@codemirror/language';
import { cjkEmphasis } from './cjk-emphasis.js';
import { chipEditState } from './chip-editing.js';
import { tableUIState } from '../LiveMarkdownTable.js';
Expand All @@ -17,6 +18,10 @@ const views: EditorView[] = [];
function editor(doc: string, cursor = doc.length) {
const view = new EditorView({ parent: document.body, state: EditorState.create({ doc, selection: { anchor: cursor }, extensions: [markdown({ base: markdownLanguage, extensions: [cjkEmphasis] }), chipEditState, tableUIState, decorations] }) });
views.push(view);
// The first parse runs on a time budget, so under load a code block late in the note can still be unparsed;
// finish the parse and let the decorations recompute, as the editor does once its parser catches up.
ensureSyntaxTree(view.state, view.state.doc.length, 5000);
view.dispatch({});
return view;
}
afterEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion scripts/vercel-sparse-non-deploy-paths.mjs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Tracked top-level Core paths that the Vercel build and runtime do not need.
export const nonDeployPaths = ['.claude', '.codex', '.dockerignore', '.env.example', '.git-blame-ignore-revs', '.github', '.gitignore', '.oxlintrc.json', 'Dockerfile', 'README.md', 'README.zh-TW.md', 'compose.local.yaml', 'compose.yaml', 'docker.env.example', 'docs', 'dprint.json', 'examples', 'scripts'];
export const nonDeployPaths = ['.claude', '.codex', '.dockerignore', '.env.example', '.git-blame-ignore-revs', '.github', '.gitignore', '.oxlintrc.json', 'Dockerfile', 'README.md', 'README.zh-TW.md', 'compose.local.yaml', 'compose.yaml', 'docker.env.example', 'docs', 'dprint.json', 'examples', 'scripts', 'vitest.config.ts'];
Loading