Comments (3)
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.
from microlight.
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
from microlight.
@gurugeek your change does not do what I suggested.
from microlight.
Related Issues (9)
- Use in NodeJS? HOT 1
- Support for live highlighting in a contenteditable element HOT 3
- Use options instead hardcoded variables to customize style HOT 1
- This is the coolest thing ever!!! HOT 6
- Highlight selected keyword HOT 1
- when load jquery 3 firstly, it broke.
- Is there any example to use it with react app? HOT 1
- Microlight won't highlight HTML elements properly at all HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.