edge-lexer
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -14,2 +14,3 @@ import { ITags, IToken } from '../Contracts'; | ||
private openedTags; | ||
private _skipNewLine; | ||
constructor(template: string, tagsDef: ITags, options: tokenizerOptions); | ||
@@ -16,0 +17,0 @@ private _getRawNode; |
@@ -17,2 +17,3 @@ "use strict"; | ||
this.openedTags = []; | ||
this._skipNewLine = false; | ||
} | ||
@@ -146,6 +147,2 @@ _getRawNode(text) { | ||
if (this.openedTags.length) { | ||
const latestTag = this.openedTags[this.openedTags.length - 1]; | ||
if (tag.type === 'newline' && !latestTag.children.length) { | ||
return; | ||
} | ||
this.openedTags[this.openedTags.length - 1].children.push(tag); | ||
@@ -177,8 +174,12 @@ return; | ||
} | ||
this._pushNewLine(); | ||
if (!this._skipNewLine) { | ||
this._pushNewLine(); | ||
} | ||
const tag = Detector_1.getTag(line, this.line, 0, this.tagsDef); | ||
if (tag) { | ||
this._handleTagOpening(line, tag); | ||
this._skipNewLine = true; | ||
return; | ||
} | ||
this._skipNewLine = false; | ||
const mustache = Detector_1.getMustache(line, this.line, 0); | ||
@@ -185,0 +186,0 @@ if (mustache) { |
@@ -0,1 +1,11 @@ | ||
<a name="2.0.3"></a> | ||
## [2.0.3](https://github.com/edge-js/edge-lexer/compare/v2.0.2...v2.0.3) (2018-11-09) | ||
### Bug Fixes | ||
* **Tokenizer:** do not add newline after tags ([19f5aff](https://github.com/edge-js/edge-lexer/commit/19f5aff)) | ||
<a name="2.0.2"></a> | ||
@@ -2,0 +12,0 @@ ## [2.0.2](https://github.com/edge-js/edge-lexer/compare/v2.0.1...v2.0.2) (2018-11-09) |
{ | ||
"name": "edge-lexer", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Parses raw markup files to converts them to Edge tokens", | ||
@@ -5,0 +5,0 @@ "main": "build/src/Tokenizer/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30906
537