Skip to content

Conversation

@JRJurman
Copy link
Member

@JRJurman JRJurman commented Oct 14, 2017

Summary

This includes the changes to support self-closing tags (as documented in choojs/hyperx#58)

Resolves #36

Changes

  • allow custom elements to be self-closing
const emptyTag = () => html`<span>my tag</span>`
const html = Tram.html({'empty-tag': emptyTag})

// before
html`<div><empty-tag></empty-tag>Hello</div>`
//  returns: <div><span>my tag</span>Hello</div>

// after
html`<div><empty-tag />Hello</div>`
// returns:  <div><span>my tag</span>Hello</div>

Warning

This may break current functionality depending on how you wrote tags that were already considered self-closing (e.g. <br>). Those tags need to now have an ending /> in their tag.

@JRJurman JRJurman requested a review from ethanjurman October 14, 2017 20:36
Copy link
Contributor

@ethanjurman ethanjurman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JRJurman JRJurman merged commit 455c1fd into master Oct 14, 2017
@JRJurman JRJurman deleted the self-closing-tags branch October 19, 2017 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants