Skip to content

Fail to insert an empty string attribute #18

@foxever

Description

@foxever

isFalse('') returns true do nothing, testing with Node.js 0.10.40.

function isFalse(s) {
  return typeof s !== 'number' && !s;
}

writeAttribute : function (name, content) {
    if (typeof content == 'function') {
      content = content();
    }
    if (isFalse(content)) {
       return this;
    }
    return this.startAttribute(name).text(content).endAttribute();
}

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