Skip to content
This repository was archived by the owner on Mar 23, 2025. It is now read-only.

[Bug] mango.text is not working correctly when tag name is <script> #40

@Zebartin

Description

@Zebartin

Plugin
ManhuaDB

Describe the bug
ManhuaDB plugin fails to function due to the following line. I tried printing out what script is and mango returns empty string or something like \n.

var script = mango.text(mango.css(html, 'script')[7]);
script = script.substring(16, script.length - 2);

After I replace the above line with the following code, the plugin works properly.

var script = mango.css(html, 'script')[7];
script = script.substring(16 + 8, script.length - 2 - 9);  // 8 means <script> and 9 means </script>

To Reproduce

  1. Add mango.raise(script) after L63 in index.js;
  2. Download anything from ManhuaDB plugin;
  3. See what Mango produces.

Expected behavior

mango.text should extract the text inside script tag.

Screenshots

Mango version
v0.27.0

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions