MCPcopy
hub / github.com/pallets/jinja / _output_child_pre

Method _output_child_pre

src/jinja2/compiler.py:1476–1490  ·  view source on GitHub ↗

Output extra source code before visiting a child of an ``Output`` node.

(
        self, node: nodes.Expr, frame: Frame, finalize: _FinalizeInfo
    )

Source from the content-addressed store, hash-verified

1474 return finalize.const(const) # type: ignore
1475
1476 def _output_child_pre(
1477 self, node: nodes.Expr, frame: Frame, finalize: _FinalizeInfo
1478 ) -> None:
1479 """Output extra source code before visiting a child of an
1480 ``Output`` node.
1481 """
1482 if frame.eval_ctx.volatile:
1483 self.write("(escape if context.eval_ctx.autoescape else str)(")
1484 elif frame.eval_ctx.autoescape:
1485 self.write("escape(")
1486 else:
1487 self.write("str(")
1488
1489 if finalize.src is not None:
1490 self.write(finalize.src)
1491
1492 def _output_child_post(
1493 self, node: nodes.Expr, frame: Frame, finalize: _FinalizeInfo

Callers 1

visit_OutputMethod · 0.95

Calls 1

writeMethod · 0.95

Tested by

no test coverage detected