Skip to content

Optional tags problem #91

@dy

Description

@dy

According to the standard, some elements may omit closing tags.
Example:

import htm from 'https://unpkg.com/htm?module'
let html = htm.bind((a, b, c) => console.log(a, b, c))

html`<ul><li><li></ul>`

As we see in the output, a single h('li', null, undefined) was called.

It seems that htm disregards the actual closing tag and just matches the </ signature, so that any open tag can be closed with "generic" end tag as <someTag><//>, which is quite handy in many ways.

This brings more serious problem with br tag.
Example (from the spec):

html`<p>P. Sherman<br>
42 Wallaby Way<br>
Sydney</p>`

that gives a single h('br', null, undefined) call.

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