Skip to content

[Feature] location property in AST #44

@anikethsaha

Description

@anikethsaha

currently, we don't process any location property for the nodes. It is because htmlparser2 doesn't support it from the core. I have seen some implementation where they are using domhandler to get the raw HTML and add location property in it. The implementation slightly went over my head and I do think it might break our current cast.

As discussed with @Scrum , we need to take a performance factor as well and we should not break implement anything that changes the AST. (we can add it. )

I am trying to implement at least the line property with the current htmlparser2 options but i haven't figure out the way to implement the columns. (still thinking. 🤔 )

I would appreciate a lot if anyone else has better approach without changing much.

I will submit a PoC soon with my changes.

cc @Scrum @cossssmin , thoughts ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions