Skip to content

Fails silently for attribute values that aren't strings #2

@ghost

Description

I expected html-tag to accept numbers as values, for say this:

htmlTag(
  'rect',
  {
    x: 10,
    y: 10,
    width: 30,
    height: 30,
    stroke: 'black'
  }
)

Which currently outputs:

<rect stroke="black">

It might be nice to either throw an error for values that aren't strings, or allow the usage of numbers. Not a big deal, but I think it'd be a little more user friendly.

https://github.com/jonschlinkert/html-tag/blob/master/index.js#L35

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions