feat(code-block): offer /code on the PDF editor and every registered language #827
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
Reviewed/Confirmed
Reviewed/Duplicate
Reviewed/Invalid
Reviewed/Won't Fix
Status/Abandoned
Status/Blocked
Status/Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
project-halkyon/halkyon-learn!827
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/827/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two ways a code block was out of reach of the author who wanted one.
The PDF flashcard editor had no
/code. AppFlowy's slash menu takes asingle
slashMenuItemslist rather than a base plus an overlay, so a hostinjecting its own entries replaces the list instead of extending it. The PDF
editor injects
/screenshot, and the replacement branch it fell into namedonly
standardSelectionMenuItems— so code, table, callout, spoiler, audio,youtube and the study button all silently vanished from the one surface where
you are transcribing a page of a programming book. Math had already been
hand-restored there for the same reason, which is the shape of the bug: every
new block has to remember this branch exists.
Code joins math. The others stay out on purpose — that menu lives in a narrow
sidebar and is long already, and a formula or a snippet is what a PDF-sourced
card actually needs. The branch moves out of the widget's build into
curatedSlashMenuItems, so what a curated surface offers is a value a testcan read rather than an expression buried in a private State.
Six languages had grammars but no way to pick them.
go,rust,kotlin,c,cppandrwere registered incode_highlighting.dart—imported, bundled, and already colouring imported decks — while
kCodeBlockLanguages, the block's language menu, omitted them. An authorwriting Go by hand got no highlighting and no way to ask for it, even though
the grammar was sitting in the binary. They are listed now, and the two lists
are pinned to each other in both directions by tests: no menu entry without a
grammar (which would read as a broken choice), and no grammar the menu hides
(which would be bundle weight nobody can reach).
consoleandtextremainthe two deliberate exceptions, present to mean "verbatim".
Signed-off-by: Tizian 「ティツィアーン」 raisondetredev@pm.me