sharpchi / moodle-filter_syntaxhighlighter

14 stars 10 forks source link

file name error #18

Open pbryitu opened 2 years ago

pbryitu commented 2 years ago

the amd/build/hljs.js file is missing the .min.js, and this is a big problem when you are in debug mode in moddle, then the plugin just don't work

this is becuase require.php is looking for the amd/build/hkjs.min.js and replace the build and min.js part to find the src/dev version of the file

the fix is easy just rename the amd/build/hljs.js file to amd/build/hljs.min.js

dnutzz commented 2 years ago

Indeed, the build file is missing the .min.js ending therefore the filter isn't working and throws errors to the console:

require.js:1961 GET http://localhost/lib/requirejs.php/-1/filter_syntaxhighlighter/hljs.js net::ERR_ABORTED 404 (not found)

Renaming amd/build/hljs.js to amd/build/hljs.min.js solves the problem. Could you please update this in your source code?

pbryitu commented 2 years ago

this look like a dead project sadly, looking on the history this may be fix in 4 years, anyone who use this plugin in the mean time, just rename the build JS file and the plugin still works, as i see the changes in moodle 4.0 you need a other option then..

sharpchi commented 2 years ago

Hello chaps. You're welcome to do a pull request. It's important to note that the plugin does work under normal operation, it's just the debug situation you're talking about. Plugin was updated a few months ago, so clearly not a "dead project", what a ridiculous comment.

Moodle 4 isn't out yet. I'm sure I'll be checking when it arrives. If, in the meantime, you wish highlight which changes in Moodle 4 will affect this plugin, then that would be very useful indeed.