Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for self-closing tags #45

Merged
merged 3 commits into from
Oct 14, 2017
Merged

add support for self-closing tags #45

merged 3 commits into from
Oct 14, 2017

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.

2 participants