Skip to content

Automatically add missing root element #22

@zdenko

Description

@zdenko

Would it be wrong if the missing root element is automatically added:

So

.one               
.two

becomes

div
  .one               
  .two

I did a test with a small change in the compiler.coffee, and it works.

compile = (parseTree, {compiler, runtime, exports}={}) ->
  if parseTree.length > 1
    parseTree = [{tag: "div", children: parseTree}]

The only caveat here is that the HTML output might not be what the user expects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions