• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

harttle / liquidjs / 40740851194
99%

Build:
DEFAULT BRANCH: master
Ran 28 Oct 2026 06:00PM UTC
Jobs 1
Files 119
Run time 1min
Badge
Embed â–¾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Oct 2026 05:59PM UTC coverage: 99.38% (+0.002%) from 99.378%
40740851194

push

github

web-flow
fix(filters): truncate and slice must not split surrogate pairs (#981)

* fix(filters): truncate and slice must not split surrogate pairs

truncate and slice cut strings by UTF-16 code unit, so a cut that landed
inside an emoji or other astral character left a lone surrogate in the
output, e.g. {{ "a😀b" | slice: 1, 1 }} returned "\ud83d". A lone
surrogate becomes U+FFFD when the output is encoded as UTF-8.

Move a cut that falls between the two halves of a pair to the nearest
boundary inside the range. Lengths are still counted in UTF-16 code
units, so output may be shorter than requested by one unit. Strings
without surrogate pairs are unaffected.

* fix(filters): truncate and slice count and cut by code point

Count and cut by Unicode code point instead of UTF-16 code unit, as
Shopify/liquid does (String#length, String#[] and String#slice are
character based in Ruby). This also stops a cut from leaving half of a
surrogate pair behind, e.g. {{ "a😀b" | slice: 1, 1 }} returned "\ud83d"
and now returns "😀".

truncate counts the length of the ellipsis in code points as well.
Offsets are resolved by walking the string once, so a negative slice
offset or a deep truncate costs O(length of the string).

1203 of 1224 branches covered (98.28%)

Branch coverage included in aggregate %.

16 of 16 new or added lines in 3 files covered. (100.0%)

3128 of 3134 relevant lines covered (99.81%)

19486.99 hits per line

Jobs
ID Job ID Ran Files Coverage
1 40740851194.1 28 Oct 2026 06:00PM UTC 119
99.38
GitHub Action Run
Source Files on build 40740851194
  • Tree
  • List 119
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 57016ebc on github
  • Prev Build on master (#40561048323)
  • Next Build on master (#40743699898)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc