Skip to content
This repository was archived by the owner on May 17, 2019. It is now read-only.
This repository was archived by the owner on May 17, 2019. It is now read-only.

Document or expose additional information for escaped HTML strings #272

Open
@KevinGrandon

Description

@KevinGrandon

Right now when a developer performs console.log() on a string escaped by the html method in fusion-core, it's logged as an empty object. This makes it pretty confusing, so it would be nice if

At a minimum we should have some more comments in sanitization.js. It would be nice if we could expose some additional information as enumerable keys, possibly nesting the object? Quick sketch:

    const obj = {
         description: "An escaped HTML value. Use consumeSanitizedHTML to output."
    };
    Object.defineProperty(obj, key, {
      enumerable: false,
      configurable: false,
      value: head + values.map((s, i) => escape(s) + rest[i]).join(''),
    });
return obj;

const obj = {};
Object.defineProperty(obj, key, {
enumerable: false,
configurable: false,
value: head + values.map((s, i) => escape(s) + rest[i]).join(''),
});
return obj;

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