Skip to content

Use the DOM to parse HTML snippets #11

Open
@matthewp

Description

@matthewp

Instead of using regexes which have the problem of being regexes, you could parse these using the DOM instead.

let template = document.createElement('template');
template.innerHTML = html;

// Pluck out scripts and styles, etc.

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