Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
highlightjs-solidity
Advanced tools
highlight.js syntax definition for Ethereum's Solidity language
highlight.js
syntax definition for Solidity.
For more about highlight.js, see https://highlightjs.org/
For more about Solidity, see http://docs.soliditylang.org/
If you're not using a build system and just want to embed this in your webpage:
<script type="text/javascript" src="/path/to/highlight.min.js"></script>
<script type="text/javascript" src="/path/to/solidity.min.js"></script>
<script type="text/javascript" src="/path/to/yul.min.js"></script>
<script type="text/javascript">
hljs.highlightAll();
</script>
If you're using webpack / rollup / browserify / node:
var hljs = require('highlightjs');
var hljsDefineSolidity = require('highlightjs-solidity');
hljsDefineSolidity(hljs);
hljs.initHighlightingOnLoad();
Doing this will define both solidity
and yul
languages.
If you want to use this in your webpage, this package uses highlight.js's CDN build system to build its Solidity and Yul grammars.
This package is not currently compatible with highlight.js version 11.
This is a pretty simple package, the only thing you might want to do differently is name the languages something other than solidity
or yul
. If you want to do this, simply import { solidity, yul } from 'highlightjs-solidity';
and do hljs.registerLanguage('othername1', solidity);
and hljs.registerLanguage('othername2', yul);
.
Originally authored by pospi, currently maintained by Truffle.
FAQs
highlight.js syntax definition for Ethereum's Solidity language
The npm package highlightjs-solidity receives a total of 12,215 weekly downloads. As such, highlightjs-solidity popularity was classified as popular.
We found that highlightjs-solidity demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.