Skip to content

Make validateLink, normalizeLink, and normalizeLinkText pluggable #128

@vberlier

Description

@vberlier

I'm trying to parse markdown with data urls that aren't compatible with the built-in link validator. I would like to provide my own validator like the docstring of the validateLink function suggests but I don't see any documented way of doing that appart from monkey-patching the module.

[my link](data:application/octet-stream;base64,H4sIAAAAAAAAAI2SwWrDMBBER3Kc2sqhPfXQT+m559JTrmFjr10RRTLSQqFfHxsi0gZaa0EHwdPMrBgDtNgk+80VgF+nRcNerFhOWKbF9uhCd0pmvjy2qKaQMpxHVaiTkPD1xU9GZaiA0f8wusALV621PKogjyrIs+aFzK146YI8uiBPidf9H6o/dl9j7r0W5mEixyK8VEU32LzTmfF8tp67SIO8JgmeD8do5zrBwHzEMHFcqtZg9zXrRBfGkXvUA7nEDbYDddaPqH2I8oks+XSTdNT3HOdUuzcS2nNMNnjAvOACT0G+1eQCAAA=)

I'm building a custom renderer so I'm using the .parse() method directly.

p_open, inline, p_close = MarkdownIt().parse(...)
inline.children[0].type  # expected "link" but returns "text" instead

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