Skip to content

Conformance Examples 0.1.0 — Transforms: transform-strip_newlines

strip_newlines-removes-LF

All LF characters are removed.

Template

[{{ phrase | strip_newlines }}]

Context

{
    "phrase": "a\nb\nc"
}

Output

[abc]

strip_newlines-removes-CR-LF

Both CR and LF are removed; other whitespace stays.

Template

[{{ phrase | strip_newlines }}]

Context

{
    "phrase": "a\r\nb \tc"
}

Output

[ab     c]

strip_newlines-no-newlines

Input without newlines passes through unchanged.

Template

[{{ phrase | strip_newlines }}]

Context

{
    "phrase": "abc"
}

Output

[abc]

strip_newlines-empty-string

Empty input stays empty.

Template

[{{ phrase | strip_newlines }}]

Context

{
    "phrase": ""
}

Output

[]

Source fixture: transforms/transform-strip_newlines.json