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 Namespaces in CJSX #12

Merged
merged 1 commit into from
Jun 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/parser.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ module.exports = class Parser
# [3] self closing?
OPENING_TAG = /// ^
<
([-A-Za-z0-9_]+) # tag name (captured)
([-A-Za-z0-9_\.]+) # tag name (captured)
(
(?:\s+[\w-]+ # attr name
(?:\s*=\s* # equals and whitespace
Expand All @@ -380,7 +380,7 @@ OPENING_TAG = /// ^
///

# [1] tag name
CLOSING_TAG = /^<\/([-A-Za-z0-9_]+)[^>]*>/
CLOSING_TAG = /^<\/([-A-Za-z0-9_\.]+)[^>]*>/

# [0] attr=val
# [1] attr
Expand Down
16 changes: 16 additions & 0 deletions test/output-testcases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -501,3 +501,19 @@ tag with {{}}
##expected
Person({"name": ({value: item, key, item})})
##end

##desc
tag with namespace
##input
<Something.Tag></Something.Tag>
##expected
Something.Tag(null)
##end

##desc
self closing tag with namespace
##input
<Something.Tag />
##expected
Something.Tag(null)
##end