Skip to content

feat(web-pkg): support markdown YAML frontmatter in the text editor - #3272

Merged
kulmann merged 9 commits into
mainfrom
feat/markdown-frontmatter
Sep 2, 2026
Merged

kulmann merged 9 commits into
mainfrom
feat/markdown-frontmatter

Conversation

@kulmann

@kulmann kulmann commented Aug 31, 2026

Copy link
Copy Markdown
Member

Description

Adds a frontmatter custom node and integrates it into markdown toolbar and slashcommand-menu:

  • Frontmatter only valid on markdown content
  • Frontmatter can be toggled off (= delete with confirmation) or on (= if already present: jump cursor into the box, if not present yet: create one at the top of the document)
  • pressing delete in front of or after the frontmatter just moves the cursor into the frontmatter-box to avoid accidental deletion
  • all the markdown goodies are disabled when the cursor is in the frontmatter-box, only plain text (and emojis) are allowed in there
  • frontmatter content is not interpreted as YAML (at least not in this PR for the sake of simplicity), just rendered and manipulated as plain text

Related Issue

How Has This Been Tested?

  • unit tests
  • manually standalone
  • manually with y.js session

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@JammingBen JammingBen left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One somewhat critical finding: having something between two --- inside a quote gets erased. E.g. a markdown file with:

> ---
> a: 1
> ---

Foo

Will result in Foo.

Some smaller findings, still worth looking into IMO:

  • Keybinding keep working inside frontmatter. E.g. ctrl/cmd + alt + 1 destroys the frontmatter and makes it a headline.
  • Claude found that not passing a custom marked instance to MarkdownManager will make it use a singleton. This singleton gets appended every extension carrying a markdownTokenizer and never gets cleaned up. This leads to more and more tokenizers getting appended and running. The solution is to create a marked instance ourselves per strategy and pass it to the MarkdownManager (and possibly the markdown extension?).

@github-project-automation github-project-automation Bot moved this to Qualification in OpenCloud Team Board Aug 31, 2026
@kulmann kulmann changed the title feat(web-pkg): support markdown frontmatter in the text editor feat(web-pkg): support markdown YAML frontmatter in the text editor Sep 1, 2026
@kulmann
kulmann requested a review from JammingBen September 1, 2026 13:56
@kulmann
kulmann force-pushed the feat/markdown-frontmatter branch from 2de6edf to ade5535 Compare September 1, 2026 14:03
@AlexAndBear
AlexAndBear force-pushed the feat/markdown-frontmatter branch from c16e42e to 32d6cdf Compare September 2, 2026 00:04

@AlexAndBear AlexAndBear left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

Mirror code-block triple-enter exit behavior in frontmatter and align the frontmatter screen-reader hint with the actual shortcuts.
@kulmann
kulmann merged commit cfeddb9 into main Sep 2, 2026
31 checks passed
@kulmann
kulmann deleted the feat/markdown-frontmatter branch September 2, 2026 06:47
@github-project-automation github-project-automation Bot moved this from Qualification to Done in OpenCloud Team Board Sep 2, 2026
@openclouders openclouders mentioned this pull request Sep 2, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

text-editor corrupts YAML frontmatter on save — even when nothing was edited

3 participants