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

nette / latte / 28710508693
94%

Build:
DEFAULT BRANCH: master
Ran 04 Jul 2026 03:16PM UTC
Jobs 1
Files 183
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

04 Jul 2026 03:15PM UTC coverage: 94.108% (-0.8%) from 94.946%
28710508693

push

github

dg
added |json filter with context-aware encoding

New |json filter (Helpers::encodeJson(), refactored out of escapeJs()
without the HtmlStringable unwrap branch). As the last filter in a chain
it carries a special, context-dependent meaning:

- HTML attribute as a whole value (via ExpressionAttributeNode), e.g.
  `data-x={$arr|json}`, routes to HtmlHelpers::formatJsonAttribute(),
  the same JSON + smart-quoting mechanism used by formatDataAttribute().
- JavaScript context (a <script> element, an on* attribute, or a JS
  content-type template, detected via Escaper::isJavaScript()) drops
  |json in PrintNode: escapeJs() already encodes to JSON there, so the
  filter is redundant and would otherwise double-encode. Dropped only
  when auto-escaping applies, so |json|noescape keeps it.
- Everywhere else (HTML text, XML, ...) |json runs as a regular filter
  and its output passes through the normal escaper, so '<', '>', '&' and
  quotes stay escaped.

Not being last, |json is a plain filter with no special handling. Both
nodes special-case it without mutating the AST: they clone the modifier
before removing the filter.

29 of 29 new or added lines in 6 files covered. (100.0%)

11 existing lines in 5 files now uncovered.

6021 of 6398 relevant lines covered (94.11%)

0.94 hits per line

Coverage Regressions

Lines Coverage ∆ File
7
97.59
-0.21% src/Latte/Essential/Filters.php
1
96.77
5.11% src/Latte/Compiler/Nodes/Php/ModifierNode.php
1
97.22
0.04% src/Latte/Essential/Nodes/EmbedNode.php
1
93.33
-6.67% src/Latte/Extension.php
1
96.0
0.0% src/Latte/Runtime/Helpers.php
Jobs
ID Job ID Ran Files Coverage
1 28710508693.1 04 Jul 2026 03:16PM UTC 183
94.11
GitHub Action Run
Source Files on build 28710508693
  • Tree
  • List 183
  • Changed 9
  • Source Changed 0
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 769a69d8 on github
  • Prev Build on master (#28670472012)
  • Next Build on master (#28723402210)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc