Skip to content

feat: add newline filter#854

Open
Ed-Gibbs wants to merge 1 commit intoharttle:masterfrom
Ed-Gibbs:feature/newline-filter
Open

feat: add newline filter#854
Ed-Gibbs wants to merge 1 commit intoharttle:masterfrom
Ed-Gibbs:feature/newline-filter

Conversation

@Ed-Gibbs
Copy link

@Ed-Gibbs Ed-Gibbs commented Mar 6, 2026

Summary

Adds a newline filter that appends a newline (\n) if the string does not already end with one.

This is useful for scenarios where we are limited to single line string inputs and provides explicit, normalised newline behaviour that is consistent across platforms.

Example

{{ "Hello" | newline }}World

Output:
Hello
World

Tests

Added integration tests for:

  • normal case
  • existing newline
  • windows newline

@harttle
Copy link
Owner

harttle commented Mar 7, 2026

Hi @Ed-Gibbs thanks for the implementation. Currently LiquidJS seeks to include only shopify/liquid and Jekyll tags/filters, and other vital tags like json.

Thus this MR will not be merged now, but I'd like to keep this open and see whether others also have interest on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants