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

Incorrect source position before comment. #70

Closed
jgm opened this issue Jan 20, 2018 · 5 comments
Closed

Incorrect source position before comment. #70

jgm opened this issue Jan 20, 2018 · 5 comments

Comments

@jgm
Copy link

jgm commented Jan 20, 2018

With tagsoup 0.14.2:

Prelude Text.HTML.TagSoup> parseTagsOptions parseOptions{ optTagWarning = True, optTagPosition = True } "<div><!--foo-->bar</div>"
[TagPosition 1 1,TagOpen "div" [],TagPosition 1 8,TagComment "foo",TagPosition 1 16,TagText "bar",TagPosition 1 19,TagClose "div"]

If I'm not terribly confused, the third token should be TagPosition 1 6, not TagPosition 1 8. The open tag consists of five characters. Is this a bug?

See jgm/pandoc#4282.

@jgm
Copy link
Author

jgm commented Jan 21, 2018

Compare

Prelude Text.HTML.TagSoup> parseTagsOptions parseOptions{ optTagWarning = True, optTagPosition = True } "<div>a</div>"
[TagPosition 1 1,TagOpen "div" [],TagPosition 1 6,TagText "a",TagPosition 1 7,TagClose "div"]

Here we get TagPosition 1 6, which I'd expect in both cases after the open tag.

@ndmitchell
Copy link
Owner

Thanks for the report - yep - I had a pos in the wrong place. Moved and tests added. I'll make a release as soon as it passes my CI.

@jgm
Copy link
Author

jgm commented Jan 21, 2018

Excellent, thanks!

@ndmitchell
Copy link
Owner

0.14.3 now out - let me know if you find any further issues.

@jgm
Copy link
Author

jgm commented Jan 21, 2018 via email

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

2 participants