Skip to content

Commit 6dfb229

Browse files
The code extending the functionality of --text has been removed.
It was deleted due to lack of necessity and the creation of errors.
1 parent 15d2d1a commit 6dfb229

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

elementOfHtml.js

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -140,31 +140,17 @@ export class ElementOfHtml {
140140
if (!this.text) return
141141

142142
// Removing extra quotes
143-
let splittedText = this.text
144-
.split(',')
145-
.map(str => str.trim().slice(1, -1))
146-
147-
switch (splittedText.length) {
148-
case 1:
149-
this.text = splittedText[0]
150-
break
151-
case 2:
152-
[this.text, this.textAfter] = splittedText
153-
break
154-
default:
155-
[this.textBefore, this.text, this.textAfter] = splittedText
156-
break
157-
}
158-
159-
this.textBefore ??= entryRule.declarations.find(
143+
this.textBefore = entryRule.declarations.find(
160144
decl => decl.property == '--text-before'
161-
)
162-
?.value.slice(1, -1)
163-
164-
this.textAfter ??= entryRule.declarations.find(
145+
)?.value
146+
this.textAfter = entryRule.declarations.find(
165147
decl => decl.property == '--text-after'
166-
)
167-
?.value.slice(1, -1)
148+
)?.value
149+
150+
// Removing extra quotes
151+
this.text = this?.text?.slice(1, -1)
152+
this.textBefore = this?.textBefore?.slice(1, -1)
153+
this.textAfter = this?.textAfter?.slice(1, -1)
168154
}
169155
#setTextFromComments(entryRule) {
170156
const replaceRegexp = / {1,}text(|-(before|after)): ?/

0 commit comments

Comments
 (0)