Skip to content

feat: Highlight support - #672

Closed
fuscodev wants to merge 4 commits into
docmost:mainfrom
fuscodev:highlight-support
Closed

fuscodev wants to merge 4 commits into
docmost:mainfrom
fuscodev:highlight-support

Conversation

@fuscodev

Copy link
Copy Markdown
Contributor

highlight

@shenzhongkang

Copy link
Copy Markdown

==highlight== in imported markdown file, can not render as highlight mark.

@Philipinho

Copy link
Copy Markdown
Member

I plan to support this with a different implementation.
Thanks for your time working on this.

@Philipinho Philipinho closed this Sep 4, 2025
vvzvlad pushed a commit to vvzvlad/gitmost that referenced this pull request Jul 17, 2026
vvzvlad pushed a commit to vvzvlad/gitmost that referenced this pull request Jul 17, 2026
…seHash

Three unrelated CI failures accumulated on develop, each a feature drifting
from its test/mirror:

- static.module.spec: add the getOfflineGrace stub (docmost#640) to the integration
  test's EnvironmentService mock; its absence threw in onModuleInit and reddened
  the whole SPA-catch-all describe.
- metrics/mcp: route the three RYOW metrics the @docmost/mcp package now emits
  (mcp_ryow_live/dbrow/expired_total, docmost#654) onto prom counters — previously
  routeMcpMetric had no branch, so the samples were silently discarded
  (invariant docmost#10). dbrow's `reason` label is bounded {not_loaded,
  owner_unreachable}->other. Extend the drift-guard + no-op-when-disabled tests.
- mcp e2e: thread a fresh baseHash into the four full-body overwrites in
  test-e2e.mjs (updatePage/updatePageJson), now that docmost#647/docmost#672 made the
  server-side write-CAS mandatory; title-only/no-op calls left untouched.

Verified: server static.module.spec + mcp.service.spec + metrics.spec green
(160 tests); test-e2e.mjs passes node --check.
vvzvlad pushed a commit to vvzvlad/gitmost that referenced this pull request Jul 17, 2026
…rf flake

Two failures surfaced after the round-1 e2e baseHash fix unblocked the mcp e2e:

- editor-ext table schema: TableCell/TableHeader did not declare an `align`
  attribute, so the docmost#647/docmost#672 server-side guarded-replace write path
  (jsonToNode -> Node.fromJSON(getSchema(editor-ext exts))) stripped GFM column
  alignment on persist — the old client-side collab write went through the
  converter schema (which HAS align), masking the drift. Mirror the converter's
  docmost-schema align onto editor-ext so the authoritative editor/collab schema
  preserves it (round-trips |:--|:-:|--:|). Invariants #7/#4.
- drawio-layout benchmark (docmost#486): the `dt < 5000` sanity bound compared TOTAL
  round-trip time (worker startup + elkjs load + IPC + the internal 5000ms ELK
  budget) against the internal budget, flaking on loaded CI runners. Loosen to
  10000ms; the event-loop-responsive / layout-applied guarantees are unchanged.

Verified: editor-ext + prosemirror-markdown build; converter tests green (895);
runtime proof that Node.fromJSON now preserves tableCell/tableHeader align;
drawio-layout perf test green locally.

Follow-up: add a CI parity check for node-attribute drift between editor-ext and
prosemirror-markdown/docmost-schema (the gap that let `align` diverge).
vvzvlad pushed a commit to vvzvlad/gitmost that referenced this pull request Jul 20, 2026
…d the pm-markdown mirror (docmost#684)

Invariant #7 says no hand-synced mirrors: the Tiptap node schema lives in
packages/editor-ext (authoritative; collab builds getSchema(tiptapExtensions))
AND packages/prosemirror-markdown/docmost-schema.ts (the PM<->MD converter). The
existing schema-surface-snapshot.test is a LOUD MANUAL review gate, and the docmost#493
contract test is asymmetric (editor-ext -> mirror only) — so attribute drift in
the OTHER direction wasn't caught. Real incident: `align` on tableCell/tableHeader
was declared in the mirror but missing from editor-ext, so after the write path
moved to server guarded-replace (docmost#647/docmost#672), Node.fromJSON(getSchema(editor-ext))
STRIPPED align -> GFM table alignment silently lost on persist. (The align fix
itself already landed on develop; this adds the missing automatic guard.)

New apps/server/src/collaboration/schema-attr-parity.spec.ts builds BOTH schemas
and diffs the attribute-NAME set of every shared node/mark in BOTH directions,
failing with the exact node+attr+direction (e.g. "tableCell.align: in mirror but
MISSING in editor-ext (write path STRIPS it)"). A documented per-attr
ACCEPTED_DIVERGENCE allowlist covers the 4 intentional structural divergences
(highlight.colorName, image.title, youtube.align, youtube.start) — each with the
side + reason; a NEW drift is never pre-blessed, so an align-class regression
still reddens. Plus a stale-allowlist test (entries can't rot) and a vacuity
guard (>20 shared types). Lives in the server package — the only place that can
import the real write-path tiptapExtensions without a third copy of the list.

Verified: schema-attr-parity 4 passed; mirror snapshot + docmost#493 contract 6 passed;
align round-trip 34 passed. Non-vacuous: removing align from editor-ext reddens
the parity test with the exact strip message. CI runs server specs via pnpm -r
test, so it's gated with no workflow change.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants