Skip to content

Line numbers for errors in the html parser #6338

Open
@yacinehmito

Description

@yacinehmito

What problem does this feature solve?

Errors raised by the html parser (options.warn in the code) don't register the location of the error.

With the location it will be much easier to debug.

For example if I forget to close an HTML tag, the compiler will complain and tell me the name of the tag. However I will have no idea where the opening tag is located. For moderately big files it's quite impractical.

What does the proposed API look like?

In parseHTML we could add a property in options that will include the line at which the HTML is included in the .vue file. We can use this to offset the location before printing it.

As for getting the locations themselves I have no idea how to proceed. If someone can give me some pointers I may submit a pull request.

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