digitalocean / do-markdownit

Markdown-It plugin for the DigitalOcean Community.
https://www.digitalocean.com/community/markdown
Apache License 2.0
85 stars 19 forks source link

Allow logging for Prism to be toggled #75

Closed MattIPv4 closed 1 year ago

MattIPv4 commented 1 year ago

Type of Change

What issue does this relate to?

N/A

What should this PR do?

Between the potential for component loading errors logging with the introduction of #69, and the potential for logging errors from bad Prism renders (keep HTML issues normally), logs can get quite noisy when rendering a lot of Markdown.

This PR adds a new option to the Prism plugin to toggle logging for errors, with the default being off. This is a change in the default behaviour, but one I feel still falls under the umbrella of a minor change as the actual output and functionality of the plugin is unchanged.

What are the acceptance criteria?

When logging is enabled, any render errors will produce an error in console. When logging is disabled, any render errors will be suppressed.