refactor(markdown-editor): drop dead export + trim duplicated comment

- FaithfulMarkdownText: drop the `export` — it has zero importers, used only
  inline by createMarkdownLayer in the same file (its sibling createFaithfulMarked
  is already a private const).
- markdown-editor.tsx: remove the reset-history tail comment that restated verbatim
  the invariant already in resetUndoHistory's header (lines 52-53); the 'when it
  fires' explanation above it stays.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Sergey Kozyrenko
2026-07-02 15:50:50 +07:00
co-authored by Claude Opus 4.8
parent c699c152a3
commit b59de20556
2 changed files with 1 additions and 5 deletions
@@ -64,7 +64,7 @@ const createFaithfulMarked = () => {
// per-extension hook), so replace that one method with identity, keeping load and save byte-symmetric.
type ManagerWithEncode = { encodeTextForMarkdown: (text: string) => string };
export const FaithfulMarkdownText = Extension.create({
const FaithfulMarkdownText = Extension.create({
name: 'faithfulMarkdownText',
onBeforeCreate() {
const manager = this.editor.markdown as unknown as ManagerWithEncode | undefined;
@@ -234,10 +234,6 @@ function MarkdownEditor({
// - on every external `setContent` (e.g. parent calls
// form.reset(serverDocument)), because that transaction is
// not a user edit either.
//
// We MUST NOT reset on every render: when the user types,
// `value` changes too, and resetting then would erase the
// user's own undo history.
if (!hasResetInitialHistoryRef.current || shouldExternalSync) {
hasResetInitialHistoryRef.current = true;
resetUndoHistory(editor);