Skip to content

micromark: render shouldn't freeze the page if jump source and destination are equal #186

@OEvgeny

Description

@OEvgeny

Initial checklist

Affected packages and versions

[email protected] and its dep [email protected]

Link to runnable example

https://bolt.new/~/sb1-7ektru or https://stackblitz.com/edit/sb1-7ektru

Steps to reproduce

  1. Open the link provided and wait until Preview appears
  2. Click Clear button
  3. Right click on the frame page, and select Inpsect (so you could stop execution)
  4. Type the following
\[
\
\]
  1. Notice the page freezes.
  2. Go to Devtools sources pane and hit pause button.
  3. Inspect the jumps object
    Screenshot from 2024-11-12 13-46-19

Environment details provided directly in the repro. Please use built-in terminal to verify versions.

❯ npm -v
10.2.3
❯ node -v
v18.20.3

Expected behavior

While the extension could have mistakes in token placement, I think it's still expected that parser won't hang during such error. EIther such jumps should be omitted or bail.

Actual behavior

Page hangs in an infinite while loop (line 2698 on the screenshot).

Runtime

Other (please specify in steps to reproduce)

Package manager

Other (please specify in steps to reproduce)

OS

Other (please specify in steps to reproduce)

Build and bundle tools

Vite

Metadata

Metadata

Assignees

No one assigned

    Labels

    👎 phase/noPost cannot or will not be acted on🙋 no/questionThis does not need any changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions