moevis / code-lighter Goto Github PK
View Code? Open in Web Editor NEWa lightweight code highlighting tool, 代码高亮工具
Home Page: https://moevis.github.io/code-lighter/
a lightweight code highlighting tool, 代码高亮工具
Home Page: https://moevis.github.io/code-lighter/
Thank you for your js, I think it's a good code-lighter.I used your js,but something goes wrong , Here is the message that the console loged:
Uncaught TypeError: Cannot read property 'replace' of undefined
at Object.$.unescapeHTML (code-lighter.js:357)
at Object.on (code-lighter.js:147)
at window.onload ((index):134)
I used in this way:
<script src="/static/moevis-code-lighter-e0388cc/dist/code-lighter.js"></script>
<script type="text/javascript">
window.onload = function () {
//comment
var code = lighter.code({target: document.getElementsByTagName("code"), language:'python', style: 'light'});
code.on();
}
</script>
My blogs save in database and code only use a tag which name "code" like this:
"# src/chapter-4/test_smtpsimple.py
import pytest
@pytest.fixture
def smtp_connection():
import smtplib
return smtplib.SMTP("smtp.163.com", 25, timeout=5)
def test_ehlo(smtp_connection):
response, _ = smtp_connection.ehlo()
assert response == 250
assert 0
"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.