8000 Typing "1984. " at the start of a Paragraph turns it into a numbered list · Issue #93 · kiran-brahma/writing-tool · GitHub
[go: up one dir, main page]

Skip to content

Typing "1984. " at the start of a Paragraph turns it into a numbered list #93

Open

Description

@kiran-brahma

What

A Writer who starts a Paragraph with a year and a period, such as 1984. The year Orwell chose., gets an ordered list numbered from 1984 as soon as they type the space.

Why

src/editor/DocumentEditor.tsx:211 uses TipTap's StarterKit unmodified. Its ordered-list input rule is /^(\d+)\.\s$/ (@tiptap/extension-list 3.31.3), so any digits, a period and a space at the start of a textblock start a list.

Is it a bug?

That is for triage. Story 199 asks that Markdown shortcuts keep working, and 1. becoming a list is exactly that shortcut. But the rule can't tell 1. from 1984. . #51 met the same ambiguity from the other side: the Writer accepted that such a Paragraph counts as one sentence, and documented it in the metrics panel. That decision assumed the Paragraph exists, and in the live Editor it usually doesn't, because this input rule runs first.

Options

  1. Accept it. The Writer can undo the conversion. Untested: TipTap's undoInputRule usually reverts it on Backspace right after it fires. If this holds, say so in How this works.
  2. Narrow the rule. For example, only a number below some limit, or only 1. to start a list. This changes a Markdown shortcut, so story 199 needs a look.
  3. Leave the shortcut and change nothing else. Close as wontfix.

How it was found

Noticed while implementing #51 (PR #72). The rule is confirmed from the extension's source; the Backspace undo in option 1 is not verified.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageMaintainer needs to evaluate this issue

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0