Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(editor): infinite loop in empty externalLink #198

Open
yhx-12243 opened this issue Nov 29, 2024 · 0 comments
Open

bug(editor): infinite loop in empty externalLink #198

yhx-12243 opened this issue Nov 29, 2024 · 0 comments
Labels
bug Something isn't working viewer

Comments

@yhx-12243
Copy link
Contributor

When I input something like {{doi:}} in editor, the parser will get an empty token (

function externalId(code: Code) {
debug('externalId %s', code)
if (code === cr || code === lf || code === crlf || code === eof) {
return nok(code)
}
if (code === rightBrace) {
effects.exit('chunkString')
effects.exit('externalId')
effects.exit('externalLink')
effects.enter('linkMarker')
return close(code)
}
effects.consume(code)
return externalId
}
), which is not allowed by micromark, in development mode it'll throw a warning (https://github.com/micromark/micromark/blob/4c09ff6682b3843b47b63238e4ed9e6f6ebcba4f/packages/micromark/dev/lib/create-tokenizer.js#L329-L335), and get UB (e.g., dead loop) on release and the user get annoyed.

(I don't know how to fix it because the error can regards as that the library does not accept empty token, in some sense)

1.mov
@StevenClontz StevenClontz added bug Something isn't working viewer labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working viewer
Projects
None yet
Development

No branches or pull requests

2 participants