Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
prettydiff committed May 22, 2019
1 parent 4202cf3 commit 46958ac
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion demo/index.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<h1>
<a href="../">Sparser</a> - demo tool
</h1>
<p class="version">1.1.10</p>
<p class="version">1.1.11</p>
<ul>
<li id="timeparse">Parsing time: <span></span></li>
<li id="timetotal">Browser time: <span></span></li>
Expand Down
2 changes: 1 addition & 1 deletion index.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<h2>License:
<a href="license">Creative Commons Zero v1.0 Universal (cc0-1.0)</a>
</h2>
<h2>Version: <span>1.1.10</span>
<h2>Version: <span>1.1.11</span>
</h2>
</div>
<div class="section">
Expand Down
4 changes: 2 additions & 2 deletions lexers/markup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@
} else if (eq < 0 && cft === undefined) {
// in most markup languages an attribute without an expressed value has its name
// as its string value
if (options.language === "html" && attstore[ind][0].charAt(0) !== "#" && (/^\*?ng[A-Z]/).test(attstore[ind][0]) === false) {
if (options.language === "html" && "[{(".indexOf(attstore[ind][0].charAt(0)) < 0 && attstore[ind][0].charAt(0) !== "#" && (/^\*?ng[A-Z]/).test(attstore[ind][0]) === false) {
record.token = attstore[ind][0].toLowerCase();
} else if (options.language === "xml" || options.language === "coldfusion") {
if (options.lexer_options.markup.quote_convert === "single") {
Expand All @@ -547,7 +547,7 @@
slice = "\"" + slice + "\"";
}
name = attstore[ind][0].slice(0, eq);
if (options.language === "html" && cft === undefined && (/^\*?ng[A-Z]/).test(attstore[ind][0]) === false) {
if (options.language === "html" && "[{(".indexOf(name.charAt(0)) < 0 && cft === undefined && (/^\*?ng[A-Z]/).test(attstore[ind][0]) === false) {
name = name.toLowerCase();
}
if (options.language === "jsx" && (/^(\s*\{)/).test(slice) === true) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
"start": "node js/services build",
"test": "node js/services test"
},
"version": "1.1.10"
"version": "1.1.11"
}
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## License
Creative Commons Zero v1.0 Universal (cc0-1.0)

## Version 1.1.10
## Version 1.1.11
Play around with this application [in your browser](https://sparser/demo/).

## Contents
Expand Down
4 changes: 4 additions & 0 deletions test/samples_code/markup/bracket_attribute_language-html.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<html>
<form id="asdf" [formGroup]="something"/>

</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{"begin":-1,"ender":4,"lexer":"markup","lines":0,"stack":"global","token":"<html>","types":"start"},
{"begin":0,"ender":4,"lexer":"markup","lines":2,"stack":"html","token":"<form/>","types":"singleton"},
{"begin":1,"ender":4,"lexer":"markup","lines":1,"stack":"form","token":"id=\"asdf\"","types":"attribute"},
{"begin":1,"ender":4,"lexer":"markup","lines":1,"stack":"form","token":"[formGroup]=\"something\"","types":"attribute"},
{"begin":0,"ender":4,"lexer":"markup","lines":3,"stack":"html","token":"</html>","types":"end"}
]

0 comments on commit 46958ac

Please sign in to comment.