mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 22:10:41 -07:00
feat: override output/tag delimiter, fixes #54
This commit is contained in:
@@ -3,10 +3,15 @@ import Token from './token'
|
||||
export default class DelimitedToken extends Token {
|
||||
trimLeft: boolean
|
||||
trimRight: boolean
|
||||
constructor (raw, pos, input, file, line) {
|
||||
constructor (raw, value, pos, input, file, line) {
|
||||
super(raw, pos, input, file, line)
|
||||
this.trimLeft = raw[2] === '-'
|
||||
this.trimRight = raw[raw.length - 3] === '-'
|
||||
this.value = raw.slice(this.trimLeft ? 3 : 2, this.trimRight ? -3 : -2).trim()
|
||||
this.trimLeft = value[0] === '-'
|
||||
this.trimRight = value[value.length - 1] === '-'
|
||||
this.value = value
|
||||
.slice(
|
||||
this.trimLeft ? 1 : 0,
|
||||
this.trimRight ? -1 : value.length
|
||||
)
|
||||
.trim()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user