WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

inconsistent behaviour rendering booleans as data attribute values #872

@cromega

Description

@cromega

Hi,

irb(main):012:0> puts Slim::Template.new { '.test data={false: false, true: true}' }.render
<div class="test" data-false="false" data-true=""></div>

Wondering if it's somehow related to rendering certain value-less attributes (eg: readonly, checked). The obvious workaround is stringifying values before passing them to the data hash but I think this behaviour is a trap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions