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

add_render_rule should give some kind of warning for attempting to add a rule with a non-existant name. #308

Open
MisterEggnog opened this issue Nov 3, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@MisterEggnog
Copy link

Context

While working on a plugin for markdown_it I did not understand the purpose of the name argument to MarkdownIt.add_render_rule, this was not helped that as best I could tell said argument had no clear purpose, (the fact that the docstring gives no information does not help either,) because of this I spent time troubleshooting why my rule was never being invoked.

Proposal

The simplest solution I think would be to include in add_render_rule or whatever part in the code that lookups the name, to log a warning if name is not one of the preset rules. I think pythons logger.warning would likely be suitable for this.

It may also be helpful to note that name must be a preset rule in the docstring for MarkdownIt.add_render_rule.

Tasks and updates

No response

@MisterEggnog MisterEggnog added the enhancement New feature or request label Nov 3, 2023
Copy link

welcome bot commented Nov 3, 2023

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant