Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: disable inline directives #41

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/plugin/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@ const registerTransform = (
// the directives plugin must be enabled
md.use(directivePlugin);

/*
Caught a bug that if there is something similar to an inline directive and a reference link,
it will be considered an inline directive and will fail during parsing
https://github.com/hilookas/markdown-it-directive/blob/master/index.js#L224
example to reproduce this bug before enable inline_directive
[aa:aa](aa.com)
[xx]: bb.com
*/
md.inline.ruler.disable('inline_directive');

(md as MarkdownItWithDirectives).blockDirectives['html'] = directiveHandler;
};

Expand Down
Loading