antfu / markdown-it-mdc

MDC (Markdown Components) syntax for markdown-it.
MIT License
101 stars 3 forks source link

fix: rules shouldn't update `state.posMax` #11

Closed KermanX closed 3 months ago

KermanX commented 3 months ago

Description

After investigations, it seems that the usage of state.pos and state.posMax was wrong. Roles shouldn't update state.posMax in common cases, and setting state.pos or state.posMax between state.push(...)s takes no effect. This PR removes the wrong/unnecessary settings of state.pos or state.posMax.

Linked Issues

fix #10. fix https://github.com/slidevjs/slidev/issues/1625.

should close PR #9.

Additional context

Couldn't find docs about state.pos or state.posMax anywhere. So I cannot guarantee the correctness 😭