DEV: Add debug hint in discourse-markdown-it
This console.debug message ONLY shows if isDevelopment() is true for the environment
This commit is contained in:
parent
8515bdf1d8
commit
5a4855b992
|
@ -1,4 +1,5 @@
|
||||||
import WhiteLister from "pretty-text/white-lister";
|
import WhiteLister from "pretty-text/white-lister";
|
||||||
|
import { isDevelopment } from "discourse-common/config/environment";
|
||||||
import { sanitize } from "pretty-text/sanitizer";
|
import { sanitize } from "pretty-text/sanitizer";
|
||||||
import guid from "pretty-text/guid";
|
import guid from "pretty-text/guid";
|
||||||
|
|
||||||
|
@ -372,6 +373,15 @@ export function setup(opts, siteSettings, state) {
|
||||||
setupInlineBBCode(opts.engine);
|
setupInlineBBCode(opts.engine);
|
||||||
setupTextPostProcessRuler(opts.engine);
|
setupTextPostProcessRuler(opts.engine);
|
||||||
|
|
||||||
|
if (isDevelopment()) {
|
||||||
|
if (window.console) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.debug(
|
||||||
|
"DEBUG: To debug all markdown plugins, add console.log within pluginCallbacks.forEach."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pluginCallbacks.forEach(([feature, callback]) => {
|
pluginCallbacks.forEach(([feature, callback]) => {
|
||||||
if (opts.discourse.features[feature]) {
|
if (opts.discourse.features[feature]) {
|
||||||
opts.engine.use(callback);
|
opts.engine.use(callback);
|
||||||
|
|
Loading…
Reference in New Issue