ueberdosis/tiptap

parseAttributes strips ids starting with number

クローズ

#7,345 opened on 2025/12/16

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)TypeScript (1,979 件のフォーク)batch import
area: coregood first issue

Repository metrics

Stars
 (23,454 個のスター)
PR merge metrics
 (平均マージ 4d 13h) (30d で 46 merged PRs)

説明

Affected Packages

core, markdown

Version(s)

3.13

Bug Description

console.log(parseAttributes('#2123 .foo'))
console.log(parseAttributes('#hello .foo'))
console.log(parseAttributes('#5hello .foo'))

produces

{ class: 'foo' }
{ class: 'foo', id: 'hello' }
{ class: 'foo' }

As parseAttributes is used by default this affects all markdown parsing more or less, at least nodes created by the official helper utils.

Browser Used

Firefox

Code Example URL

No response

Expected Behavior

I.e. any id with a leading number gets stripped. Reading https://github.com/jgm/pandoc/issues/7920 i'm unsure what to conclude.

  1. If pandoc now allows ids to start with number, then it should be the same here
  2. If not, then a warning should be added here and elsewhere, as this behaviour is not necessariliy known to people.

Additional Context (Optional)

No response

Dependency Updates

  • Yes, I've updated all my dependencies.

コントリビューターガイド