Skip to content

Disable html_safe check for JSON.pretty_generate #409

@hlascelles

Description

@hlascelles

We are seeing "erb interpolation with '<%= (...).html_safe %>' in this context is never safe" errors for this:

<%= JSON.pretty_generate(foo: :bar).html_safe %>

Due to this: https://github.com/Shopify/better-html/blob/121065400314db191cae7202073cdc8b9125b4bb/lib/better_html/test_helper/safe_erb/tag_interpolation.rb#L175

Should we make JSON.pretty_generate be "safeable" by default?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions