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

Support empty (void) tags #3

Merged
merged 6 commits into from
Dec 12, 2016
Merged

Support empty (void) tags #3

merged 6 commits into from
Dec 12, 2016

Conversation

NekR
Copy link
Collaborator

@NekR NekR commented Dec 6, 2016

@developit I'm actually not sure how it worked before without this feature, but it was producing things like <input type="text"></input> which is kind of wrong markup (though browsers understand it..).

In this PR I load list of empty tags from empty-tags module which I crated long time ago for OpenJSX. Though, if you think that it makes sense inline them directly into project (separate file but in the repo) then I'll do that.

I intentionally don't do any warning here when child elements are added to elements empty elements, but if that makes sense we can probably do that with a process.ENV === 'development' guard.

@developit
Copy link
Owner

developit commented Dec 6, 2016

Looks like we might need to tell rollup to inline empty-tags:

screen shot 2016-12-06 at 1 21 56 pm

@NekR
Copy link
Collaborator Author

NekR commented Dec 6, 2016

@developit Yeah, this is why I mentioned to just copy paste contents of that module to the repo.

@NekR
Copy link
Collaborator Author

NekR commented Dec 8, 2016

@developit to inline it with rollup it seems that I need to use either node-resolve plugin or provide js:next entry for the empty-tags. Inlining it to the projects seems easier for me so I just did that. Is it okay for you?

@developit
Copy link
Owner

developit commented Dec 8, 2016

Yup, I'm totally cool with that. Think it's ready to merge with that inlined?

edit: see comment

}
}

Copy link
Owner

Choose a reason for hiding this comment

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

Actually maybe we can simplify the sanitize mapping:

		s += `</${name}>`;
	} else {
		s += '>';
  	}

	sanitized[s] = true;
	return s;
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@developit Done.

@NekR
Copy link
Collaborator Author

NekR commented Dec 12, 2016

I think ready to merge now (if you don't have any other comments).

@developit
Copy link
Owner

Looks great!

@developit developit merged commit f7489d9 into developit:master Dec 12, 2016
@NekR
Copy link
Collaborator Author

NekR commented Dec 12, 2016

Great, thank you! 👍

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