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

HtmlInline (and possibly other inlines) incorrect end line calculation #501

Open
SamWilsn opened this issue Dec 6, 2024 · 1 comment
Open

Comments

@SamWilsn
Copy link
Contributor

SamWilsn commented Dec 6, 2024

It seems like the sourcepos calculation for inlines (at least for HtmlInline) adds self.line_offset to the end column, instead of the line offset for the end line.

For example:

  hello <img
    src="foo"
    alt="bar"> world

Gives a sourcepos of 1:9-3:9, while:

  hello <img
    src="foo"
                              alt="bar"> world

Also gives a sourcepos of 1:9-3:9.

@kivikakk
Copy link
Owner

kivikakk commented Dec 7, 2024

(As background: indeed — sourcepos for inlines is not actually generally supported! Hence the support enabled in rendering with experimental_inline_sourcepos. @digitalmoksha has done a lot of good work on getting them more useful, but the upstream reference implementation doesn't support them at all, so Comrak's support has only recently been growing in this area.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants