ether-code 0.9.9 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/ether.js +1 -1
- package/generators/html-generator.js +19 -16
- package/package.json +1 -1
- package/parsers/ether-parser-base.js +1 -1
package/cli/ether.js
CHANGED
|
@@ -660,25 +660,28 @@ class HTMLGenerator {
|
|
|
660
660
|
this.indent++
|
|
661
661
|
|
|
662
662
|
if (isRawContent) {
|
|
663
|
-
let rawContent = ''
|
|
664
663
|
for (const child of children) {
|
|
665
|
-
if (
|
|
666
|
-
|
|
664
|
+
if (child.type === 'EtherCSS') {
|
|
665
|
+
this.generateEtherCSS(child)
|
|
666
|
+
} else if (child.type === 'EtherJS') {
|
|
667
|
+
this.generateEtherJS(child)
|
|
668
|
+
} else if (typeof child === 'string') {
|
|
669
|
+
const generatedCode = this.compileEmbeddedCode(child.trim(), tag.toLowerCase())
|
|
670
|
+
const lines = generatedCode.split('\n')
|
|
671
|
+
for (const line of lines) {
|
|
672
|
+
this.writeLine(line)
|
|
673
|
+
}
|
|
667
674
|
} else if (child.type === 'Text' || child.type === 'text') {
|
|
668
675
|
const content = child.content || child.text || child.value || ''
|
|
669
676
|
if (content.trim()) {
|
|
670
|
-
|
|
677
|
+
const generatedCode = this.compileEmbeddedCode(content.trim(), tag.toLowerCase())
|
|
678
|
+
const lines = generatedCode.split('\n')
|
|
679
|
+
for (const line of lines) {
|
|
680
|
+
this.writeLine(line)
|
|
681
|
+
}
|
|
671
682
|
}
|
|
672
683
|
}
|
|
673
684
|
}
|
|
674
|
-
|
|
675
|
-
if (rawContent.trim()) {
|
|
676
|
-
const generatedCode = this.compileEmbeddedCode(rawContent.trim(), tag.toLowerCase())
|
|
677
|
-
const lines = generatedCode.split('\n')
|
|
678
|
-
for (const line of lines) {
|
|
679
|
-
this.writeLine(line)
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
685
|
} else {
|
|
683
686
|
for (const child of children) {
|
|
684
687
|
if (typeof child === 'string') {
|
|
@@ -1080,14 +1083,14 @@ class HTMLGenerator {
|
|
|
1080
1083
|
if (!node.source) return
|
|
1081
1084
|
|
|
1082
1085
|
try {
|
|
1083
|
-
const { EtherParserCSS } = require('
|
|
1086
|
+
const { EtherParserCSS } = require('../parsers/ether-parser-css')
|
|
1084
1087
|
const { CSSGenerator } = require('./css-generator')
|
|
1085
1088
|
|
|
1086
1089
|
const cssParser = new EtherParserCSS()
|
|
1087
1090
|
const cssAst = cssParser.parse(node.source)
|
|
1088
1091
|
|
|
1089
1092
|
const cssGenerator = new CSSGenerator()
|
|
1090
|
-
cssGenerator.loadI18n('
|
|
1093
|
+
cssGenerator.loadI18n('../i18n/i18n-css.json')
|
|
1091
1094
|
const cssOutput = cssGenerator.generate(cssAst)
|
|
1092
1095
|
|
|
1093
1096
|
if (cssOutput) {
|
|
@@ -1106,14 +1109,14 @@ class HTMLGenerator {
|
|
|
1106
1109
|
if (!node.source) return
|
|
1107
1110
|
|
|
1108
1111
|
try {
|
|
1109
|
-
const { EtherParserJS } = require('
|
|
1112
|
+
const { EtherParserJS } = require('../parsers/ether-parser-js')
|
|
1110
1113
|
const { JSGenerator } = require('./js-generator')
|
|
1111
1114
|
|
|
1112
1115
|
const jsParser = new EtherParserJS()
|
|
1113
1116
|
const jsAst = jsParser.parse(node.source)
|
|
1114
1117
|
|
|
1115
1118
|
const jsGenerator = new JSGenerator()
|
|
1116
|
-
jsGenerator.loadI18n('
|
|
1119
|
+
jsGenerator.loadI18n('../i18n/i18n-js.json')
|
|
1117
1120
|
const jsOutput = jsGenerator.generate(jsAst)
|
|
1118
1121
|
|
|
1119
1122
|
if (jsOutput) {
|
package/package.json
CHANGED