aramk/crayon-syntax-highlighter

Inline link rel=stylesheet

Closed this issue · 1 comments

I'm hoping someone can help me out here, because no matter what I've tried - I can't get rid of the inlined stylesheet that crayon is somehow appending to <body>
I've spent ages looking for a function or a... something... that is inlining the following:
<link rel='stylesheet' id='crayon-css' href='https://willstocks.co.uk/wp-content/plugins/crayon-syntax-highlighter/css/min/crayon.min.css' type='text/css' media='all'/>
but I just can't find anything!
This is resulting on unnecessary CSS loading on every single page on my site, not just posts where a Crayon exists
Does anyone have any idea how I can get rid of this?
I'm already doing:

	if( ! is_single() )
	{
		//Crayon
		wp_dequeue_style('crayon');
		wp_dequeue_style('crayon_style');
		wp_dequeue_style('crayon_admin');
		wp_dequeue_style('crayon_global_style');
		wp_dequeue_style('crayon_colorbox_css');
		wp_dequeue_style('crayon_theme_editor');
		wp_dequeue_style('jquery_colorpicker');
		wp_dequeue_style('crayon-theme-github');
		wp_dequeue_style('crayon-font-monospace');
		wp_dequeue_script('crayon_js');
		wp_dequeue_script('crayon_util_js');
		wp_dequeue_script('crayon_colorbox_js');
		wp_dequeue_script('crayon_te_js');
		wp_dequeue_script('crayon_qt_js');
		wp_dequeue_script('cssjson_js');
		wp_dequeue_script('jquery_colorpicker_js');
		wp_dequeue_script('jquery_tinycolor_js');
		wp_dequeue_script('crayon_theme_editor');
	}

Worked it out. If anyone else needs this, change:
new CrayonSetting(self::SAFE_ENQUEUE, TRUE),
to
new CrayonSetting(self::SAFE_ENQUEUE, FALSE),
in crayon_settings.class.php

new CrayonSetting(self::SAFE_ENQUEUE, TRUE),