mixmark-io/turndown

Keeping/removing metadata content elements (e.g. script, style, title)

Open

#210 opened on Dec 20, 2017

View on GitHub
 (2 comments) (1 reaction) (0 assignees)HTML (11,165 stars) (982 forks)batch import
help wanted

Description

<script>, <style>, and <title> elements are not visible on a rendered web page, however Turndown will output their contents, e.g.

turndownService.turndown('<script>alert("Hello world")</script>') // alert("Hello world")

Perhaps these could be removed by default? The behaviour could be overridden with turndownService.keep (to render the elements wrapped in their tag) or by adding a rule. Or perhaps we should keep the default behaviour and add options to keep/remove e.g. keepScript, removeScript, keepStyle, removeStyle, keepTitle, removeTitle?

Contributor guide