Skip to content

RFC: Should Includes helpers returning Html return HtmlStrings? #1734

@emmadesilva

Description

@emmadesilva

We have this class, where we document that "Both Markdown and Blade includes will be rendered to HTML". Wouldn't it then make more sense if these returned HtmlString objects instead of string types?

/**
 * The Includes facade provides a simple way to access partials in the includes directory.
 *
 * Both Markdown and Blade includes will be rendered to HTML.
 */
class Includes

This is more semantic, but has the side effect that they will no longer be escaped.

Considering the usages though, I imagine that these are already being used within literal echo directives {!! !!}. It could be a breaking change, and it needs to be communicated clearly, so possibly something for v2.x?

Metadata

Metadata

Assignees

Labels

RFCRequest For Comments

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions