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

Consider adding attribute text position info to HtmlTagToken #766

Closed
yufeih opened this issue Mar 11, 2019 · 4 comments
Closed

Consider adding attribute text position info to HtmlTagToken #766

yufeih opened this issue Mar 11, 2019 · 4 comments

Comments

@yufeih
Copy link

yufeih commented Mar 11, 2019

We are using AngleSharp to manipulate HTML in an authoring workflow, so we want to preserve the original HTML content as much as possible, including all the spaces and bad syntax, etc.

With #636 , I am able to retrieve source text position information for tags, but Attributes does not currently have position info, this prevents us from doing stuff like changing all the link urls without touching other parts of HTML.

HtmlAgilityPack has a ValueStartIndex and ValueStartLength property for each attribute.

The proposal is to provide the same text position information to HTML attributes in the tokenization layer.

@FlorianRappl
Copy link
Contributor

I think this should be doable. Thanks for the suggestion!

@FlorianRappl
Copy link
Contributor

Landed in devel.

@yufeih
Copy link
Author

yufeih commented Jul 1, 2019

@FlorianRappl , HtmlAttributeToken.Position currently points to attribute name start index, can there be an HtmlAttributeToken.ValuePosition that points to attribute value start index?

@FlorianRappl
Copy link
Contributor

@yufeih good suggestion; I think this should be doable.

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