mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 12:50:38 -07:00
feat: exported Drop interface for #107
Deprecate snake_cased options and APIs, sed #109
This commit is contained in:
@@ -29,7 +29,7 @@ export default class Parser {
|
||||
return new Tag(token as TagToken, remainTokens, this.liquid)
|
||||
}
|
||||
if (token.type === 'output') {
|
||||
return new Output(token as OutputToken, this.liquid.options.strict_filters)
|
||||
return new Output(token as OutputToken, this.liquid.options.strictFilters)
|
||||
}
|
||||
return new HTML(token)
|
||||
} catch (e) {
|
||||
|
||||
@@ -15,10 +15,10 @@ export default class Tokenizer {
|
||||
}
|
||||
tokenize (input: string, file?: string) {
|
||||
const tokens: Token[] = []
|
||||
const tagL = this.options.tag_delimiter_left
|
||||
const tagR = this.options.tag_delimiter_right
|
||||
const outputL = this.options.output_delimiter_left
|
||||
const outputR = this.options.output_delimiter_right
|
||||
const tagL = this.options.tagDelimiterLeft
|
||||
const tagR = this.options.tagDelimiterRight
|
||||
const outputL = this.options.outputDelimiterLeft
|
||||
const outputR = this.options.outputDelimiterRight
|
||||
let p = 0
|
||||
let curLine = 1
|
||||
let state = ParseState.HTML
|
||||
|
||||
@@ -23,14 +23,14 @@ export default function whiteSpaceCtrl (tokens: Token[], options: NormalizedFull
|
||||
|
||||
function shouldTrimLeft (token: DelimitedToken, inRaw: boolean, options: NormalizedFullOptions) {
|
||||
if (inRaw) return false
|
||||
if (token.type === 'tag') return token.trimLeft || options.trim_tag_left
|
||||
if (token.type === 'output') return token.trimLeft || options.trim_output_left
|
||||
if (token.type === 'tag') return token.trimLeft || options.trimTagLeft
|
||||
if (token.type === 'output') return token.trimLeft || options.trimOutputLeft
|
||||
}
|
||||
|
||||
function shouldTrimRight (token: DelimitedToken, inRaw: boolean, options: NormalizedFullOptions) {
|
||||
if (inRaw) return false
|
||||
if (token.type === 'tag') return token.trimRight || options.trim_tag_right
|
||||
if (token.type === 'output') return token.trimRight || options.trim_output_right
|
||||
if (token.type === 'tag') return token.trimRight || options.trimTagRight
|
||||
if (token.type === 'output') return token.trimRight || options.trimOutputRight
|
||||
}
|
||||
|
||||
function trimLeft (token: Token, greedy: boolean) {
|
||||
|
||||
Reference in New Issue
Block a user