I've found that syntaxhighlighter library loads in $page_bottom region of my themes (custom and garland) and not in $scripts, where it should. This, although very annoying, could be fixed moving the $scripts variable before $page_bottom, but why is it loading there? Is there any reason for this or is just me having this issue?

Comments

lovelykaushik86’s picture

I used this module but I did not find any issue like this. There is only one script syntaxhighlighter.min.js which is after all regions just before the body tag ends but this script is not in any region. If you are stil facing this issue please clarify the issue completely.

fizk’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

The code that loads syntaxhighlighter.min.js is:

drupal_add_js(drupal_get_path('module', 'syntaxhighlighter') . '/syntaxhighlighter.min.js', array('type' => 'file', 'scope' => 'footer', 'group' => JS_DEFAULT, 'every_page' => TRUE));

which tells Drupal to add it to the footer scope. This is done to load syntaxhighlighter.min.js without blocking, which improves page loading.