Open 2brownc opened 3 years ago
What would be better is:
https://github.com/asvd/microlight/blob/master/microlight.js#L39-L41
Changing this to:
- var reset = function(cls) {
+ var reset = function(nodes) {
// nodes to highlight
- microlighted = _document.getElementsByClassName(cls||'microlight');
+ microlighted = nodes || _document.getElementsByClassName('microlight');
And then release as a major version bump.
This would solve all problems in a way that is trivially backwards compatible.
Following @Qix- Idea I modified it to highlight all automatically
var reset = function(nodes) {
microlighted = document.getElementsByTagName("code");
you can find the fork here https://github.com/gurugeek/microlight/blob/master/microlight.js
@gurugeek your change does not do what I suggested.
Currently
microlight
class needs to be included in the class list. But most syntax highlight scripts automatically work on code wrapped in<pre><code>
tags.I request same behavior with
microlight.js
.