
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
enlighterjs
Advanced tools
Quickstart | Documentation | Languages | Themes | Website
EnlighterJS, an open source syntax highlighter written in pure javascript
Using it can be as simple as adding a single script and style to your website, choosing the elements you wish to highlight, and EnlighterJS takes care of the rest.
45KB JS
(all languages) + 10KB CSS
(single theme; all themes 60KB)dist/
directory to your public html locationpre
tags with data-enlighter-language
attribute)This is a minimalistic example how to highlight sourcecode with EnlighterJS. The working example (valid js+css paths) is available within the example directory.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>EnlighterJS Test</title>
<!-- EnlighterJS Resources !-->
<link rel="stylesheet" href="enlighterjs.min.css" />
</head>
<body>
<main>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
et dolore <code>window.addEvent('domready', async (a,b) => {});</code> magna aliquyam erat.
</p>
<!-- Code to hghlight !-->
<pre data-enlighter-language="less">
// buttons used in codegroups + toolbar
.enlighter-btn{
display: inline-block;
margin: 0px 5px 0px 5px;
padding: 3px 5px 3px 5px;
border: solid 1px #333333;
background-color: #f0f0f0;
cursor: pointer;
}
// buttons
.enlighter-btn-raw{
background-image: data-uri('icons/enlighter_code.svg');
}
.enlighter-btn-window{
background-image: data-uri('icons/enlighter_rawcode.svg');
}
.enlighter-btn-website{
background-image: data-uri('icons/enlighter_icon_white.svg');
}
</pre>
</main>
<script type="text/javascript" src="enlighterjs.min.js"></script>
<script type="text/javascript">
// INIT CODE - simple page-wide initialization based on css selectors
// - highlight all pre + code tags (CSS3 selectors)
// - use javascript as default language
// - use theme "enlighter" as default theme
// - replace tabs with 2 spaces
EnlighterJS.init('pre', 'code', {
language : 'javascript',
theme: 'enlighter',
indent : 2
});
</script>
</body>
</html>
EnlighterJS is OpenSource and managed on GitHub - if you like, you're welcome to contribute! To simplify the release and quality control process, please follow these remarks:
src/
or examples/
directory. Otherwise your request will be rejectedEnlighterJS is OpenSource and licensed under the Terms of Mozilla Public License 2.0. You're welcome to contribute
Version 3.4.0 ###
k11
for annotationsx16
for css element selectorsr
language support (covered by generic ruleset)RouterOS
language support (ros/mikrotik/switchos/routeros/mt)php
java
, scala
, cpp
annotation token changed to k11
k11
to themeslang/rulesets/generic
ampersandCleanup
is performed after html escape sequences to eliminate issues related to double unquoting #109php
variable and function names (side effect of the php parser)classic
theme not applied due to invalid selectors - thanks to woolseyj on GitHubFAQs
an open source syntax highlighter written in pure javascript
We found that enlighterjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.