Repository navigation
Conversation
vrana
commented
Oct 29, 2026
Member
- new feature? Engine: added renderToHtml(), throws if output is not HTML #430
- BC break? yes
Content is a string tagged with its content type, so a trusted value is not tied to HTML. Html is Content of type HTML; it still implements HtmlStringable, so printing it is unchanged. Content of another type is a plain Stringable and is escaped as text for now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wn context Like Html in HTML text, Content of the other types is trusted where its type is expected: JS in <script>, in a print inside on* and in a JS template (through convertJSToRawText, then attribute-encoded in on*), CSS likewise, XML in XML and iCal in iCal. A block from <script> or <style> (html/raw/js, html/raw/css) counts as JS or CSS. Content of any other type is still escaped as text. The escapers list the types they accept instead of asking getConvertor(), because escapeJs serves js, html/raw/js and html/attr/js without knowing which. filterContent() passes Content of the filtered type to the filter as a string. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Returns the output as Content of its effective content type: the layout's
with {extends}, or the block's when rendering a single block. HTML is returned
as Html, so it can be printed without new Html(renderToString()).
With $contentType, the output is converted to it like {include} does (a text
template is escaped into HTML), or it throws if the types are incompatible.
Template::render() applies the conversion at the end of the extends chain.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.