kazumatu981 / markdown-it-kroki

markdown-it kroki plugin.
MIT License
6 stars 2 forks source link

You must not use `url.parse()` #12

Closed kazumatu981 closed 8 months ago

kazumatu981 commented 9 months ago

url.parse() is not recommended. so use new URL(). like bellow

function toBeUrlString(test, msg) {
    this.toNonEmptyString(test, msg);
    try {
        new URL(test);
    } catch {
        throw new Error(msg);
    }
}
kazumatu981 commented 9 months ago

Use contract.toBeUrlString() in diagramEncoder.generateUrl() and remove url.parse() from MarkdownItKrokiCore.setOptions()