jarontai / html2md

A library for converting HTML to Markdown in Dart. It supports CommonMark, simple table and custom converting rules. 将html转换为markdown的Dart库,支持CommonMark、简单表格以及自定义转换规则。
https://pub.dev/packages/html2md
BSD 2-Clause "Simplified" License
57 stars 25 forks source link

content in <script> tags are not filtered out #8

Closed atn832 closed 5 years ago

atn832 commented 5 years ago

This snippet:

final html = """
<!DOCTYPE html>
<head>
    <script>
    console.log("test");
    </script>
</head>
<body>
Hello
</body>
""";
final md = html2md.convert(html);
print(md);

prints out a string that contains 'console.log("test");'. I would have expected only Hello to be included.

jarontai commented 5 years ago

Version 0.3.0 is out, you can exclude elements with the new ignore parameter.

atn832 commented 5 years ago

Thank you!