Skip to content

clarify parse rule in sfc spec to avoid highlight and compile ambiguity #1588

Open
@LongTengDao

Description

@LongTengDao

What problem does this feature solve?

Because blocks in .vue file could specify lang attribute with any value, parsing sfc in flow and by indent level will get different result some times.

And tagName in html is case-insensitive, while in vue template it's not, how to treat syntax in tag with name like TextArea? Text, or HTML? Does <Style> or <StylE> belong to component styles?

HTML also has some internal void elements, how should sfc parse them as customBlocks?

Think about this:

<Style />

<StylE />

<template lang="md">
    `</template><script>`
</template>

<br>
<br lang="css">
<br />
</br>

<script>//`</script>

What does the proposed API look like?

Specify and clarify these questions.

Personally, I suggest that we should follow the indent level, not HTML flow syntax, because langs could be unknown, or we need too much plugins and work to promise correct highlight. And flow syntax also need good indent or it will be not readable, why not follow indent directly? At least, the result parsed by html flow syntax and by indent level must be same, if not, throw an compiling error.

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