You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm upgrading from Liquid v4 to v5 and encountered a subtle yet impactful breaking change that caused us a significant number of test failures. It seems that during a refactor, the call to .to_s for a node output was unintentionally (?) dropped.
If we travel back in time and look at black_body.rb from commit c2ef24, we can appreciate how it'd still explicitly call .to_s on the output of node#render unless the result was an array.
However, while refactoring to improve rendering back in #1091 the new render_to_output_buffer dropped this, maybe by accident (?). Instead, it started "appending" the result of render directly to the output buffer without stringifying it.
This causes this funny case where if your output returns a number, the << operation ends up adding a byte instead of the stringified value.
i.e.:
The text was updated successfully, but these errors were encountered:
Andy9822
changed the title
Missing .to_s when rendering a node
Missing .to_s when rendering a node (dropped possibily by accident)
Jan 14, 2025
Hey y'all,
I'm upgrading from Liquid v4 to v5 and encountered a subtle yet impactful breaking change that caused us a significant number of test failures. It seems that during a refactor, the call to
.to_s
for a node output was unintentionally (?) dropped.If we travel back in time and look at black_body.rb from commit c2ef24, we can appreciate how it'd still explicitly call
.to_s
on the output ofnode#render
unless the result was an array.However, while refactoring to improve rendering back in #1091 the new
render_to_output_buffer
dropped this, maybe by accident (?). Instead, it started "appending" the result ofrender
directly to the output buffer without stringifying it.This causes this funny case where if your output returns a number, the
<<
operation ends up adding a byte instead of the stringified value.i.e.:
The text was updated successfully, but these errors were encountered: