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

indented code block's "range" doesn't cover indent #852

Open
ModProg opened this issue Feb 26, 2024 · 0 comments
Open

indented code block's "range" doesn't cover indent #852

ModProg opened this issue Feb 26, 2024 · 0 comments

Comments

@ModProg
Copy link

ModProg commented Feb 26, 2024

AFAICT for the other tags, even the related fenced code block the start tag starts at the end of the previous token, the content will then be covered by the following text nodes.

For indented code blocks, the leading indent is currently not part of the token's span.

I'd expect this to be correct:

use pulldown_cmark::Parser;
let text = "    code";
let range = Parser::new(text).into_offset_iter().next().unwrap().1;
assert_eq!(range, 0..8);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant