
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
highlightjs-structured-text
Advanced tools
highlight.js syntax definition for Structured Text IEC 61131-3 language
This repository provides syntax highlighting for Highlight.js for Structured Text. ST is one of the 6 languages of IEC 61131-3 standard developed in 1998 for developing PLC programs.
We want to provide ST syntax highlights in VS Code Markdown editor and Markdown preview. And other cases when tutorials are published in the web.
npm i highlightjs-structured-text --save
Include the highlight.js
script package in your webpage or node app, load this module and register it with hljs
. Follow instructions at highlightjs to learn how to include the library and CSS.
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.pack.js"></script>
<script type="text/javascript" src="/path/to/highlightjs-structured-text/dist/iecst.min.js"></script>
<script type="text/javascript">
hljs.initHighlightingOnLoad();
</script>
If you're using webpack / rollup / browserify / node:
var hljs = require('highlightjs');
var hljsDefineIECST = require('highlightjs-structured-text');
hljs.registerLanguage('iecst', hljsDefineIECST);
hljs.initHighlightingOnLoad();
Mark the code you want to highlight with the iecst class:
<pre><code class="iecst">...</code></pre>
Or use JavaScript to programmatically highlight text string:
hljs.registerLanguage('iecst', hljsDefineIECST);
var highlighted = hljs.highlightAuto(text_string, ["iecst"]);
import React, {Component} from 'react'
import 'highlight.js/scss/darcula.scss' # your favourite theme
import cypher from './iecst'
import hljs from 'highlight.js'
hljs.registerLanguage('iecst', iecst);
class Highlighter extends Component
{
constructor(props)
{
super(props);
hljs.initHighlightingOnLoad();
}
render()
{
let {children} = this.props;
return
{
<pre ref={(node) => this.node = node}>
<code className="iecst">
{children}
</code>
</pre>
}
}
}
export default Highlighter;
To use in marp
First create file engine.js
const { Marp } = require('@marp-team/marp-core')
const hljs = require('highlight.js')
const iecst = require('highlightjs-structured-text')
hljs.registerLanguage("iecst", iecst)
module.exports = (opts) => {
const marp = new Marp(opts)
marp.highlighter = (code, lang) => {
if (lang) {
return hljs.getLanguage(lang)
? hljs.highlight(lang, code, true).value
: ''
}
return hljs.highlightAuto(code).value
}
return marp
}
And now when you build with CLI add engine parameter,
npx marp --engine ./enjine.js ./slides.md
FAQs
highlight.js syntax definition for Structured Text IEC 61131-3 language
The npm package highlightjs-structured-text receives a total of 1,677 weekly downloads. As such, highlightjs-structured-text popularity was classified as popular.
We found that highlightjs-structured-text 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.