mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 12:50:38 -07:00
test: add tests for keepOutputType option
This commit is contained in:
committed by
Jun Yang
parent
cd92e77726
commit
b8e4b3337b
@@ -9,7 +9,11 @@ export class Emitter {
|
||||
}
|
||||
|
||||
public write (html: any) {
|
||||
if (this.keepOutputType && typeof html !== 'string') {
|
||||
// This will only preserve the type if the value is isolated.
|
||||
// I.E:
|
||||
// {{ my-port }} -> 42
|
||||
// {{ my-host }}:{{ my-port }} -> 'host:42'
|
||||
if (this.keepOutputType === true && typeof html !== 'string' && this.html === '') {
|
||||
this.html = html
|
||||
} else {
|
||||
this.html += html as string
|
||||
|
||||
Reference in New Issue
Block a user