Skip to content

Conversation

@jviide
Copy link
Collaborator

@jviide jviide commented Jul 29, 2019

This pull request modifies the parsing logic (and adds related tests) so that slashes in unquoted property values are allowed. For example <abba prop=val/ue><//> parses to h('ab', { prop: 'val/ue' }). The exception is when the / is immediately followed by > - <abba prop=value/> parses as a self-closing element h('ab', { prop: 'value' }).

Slashes in tag names and property names will still self-close the element. For example <ab/ba prop=value> parses to h('ab', null), and <abba pr/op=value> parses to h('abba', { pr: true }).

The regular build size grows by 8 bytes (588 B -> 596 B) and the mini build size grows by 9 bytes (417 B -> 426 B). The performance doesn't seem to be affected, based on test:perf runs with V8 on MacOS 10.14.6.

Closes #106.

@jviide jviide requested a review from developit July 29, 2019 13:47
@jviide
Copy link
Collaborator Author

jviide commented Jul 29, 2019

Added a commit that updates the main README.md to reflect the slighly increased size of the mini build.

Copy link
Owner

@developit developit left a comment

Choose a reason for hiding this comment

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

LGTM!

@jviide jviide merged commit 753d81d into developit:master Jul 29, 2019
@jviide jviide deleted the issue-106 branch July 29, 2019 16:19
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.

Prop values with slash without quotes

2 participants