
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@md-plugins/md-plugin-imports
Advanced tools
A markdown-it plugin for handling imports in markdown files.
A Markdown-It plugin that extracts and stores <script import>
blocks from Markdown content. This is useful for managing page-level imports in environments where Markdown is rendered dynamically, such as in Vue.js applications.
The imports are stored in the pageScripts
property of the Markdown-It environment (env
). During post-processing the array if imports (Set) can be used to inject the required scripts into the Vue SFC.
<script import>
blocks from Markdown content.pageScripts
property of the Markdown-It environment (env
).<script import>
blocks from the rendered output, leaving the rest of the Markdown intact.<script import>
blocks gracefully.Install the plugin via your preferred package manager:
# with pnpm:
pnpm add @md-plugins/md-plugin-imports
# with Yarn:
yarn add @md-plugins/md-plugin-imports
# with npm:
npm install @md-plugins/md-plugin-imports
import MarkdownIt from 'markdown-it';
import { importsPlugin } from '@md-plugins/md-plugin-imports';
import type { MarkdownItEnv } from '@md-plugins/shared';
const md = new MarkdownIt();
md.use(importsPlugin);
const markdownContent = `
<script import>
import A from './A.vue';
import B from './B.vue';
</script>
# Header
Some content here.
`;
const env: MarkdownItEnv = {};
const renderedOutput = md.render(markdownContent, env);
console.log('Rendered Output:', renderedOutput);
console.log('Page Scripts:', env.pageScripts);
The md-plugin-imports
plugin does not currently accept options. All <script import>
blocks are processed by default.
The plugin recognizes <script import>
blocks in the following format:
<script import>
import A from './A.vue';
import B from './B.vue';
</script>
<script import>
and end with </script>
.The plugin supports multiple <script import>
blocks in a single Markdown file:
<script import>
import A from './A.vue';
</script>
# Header
<script import>
import B from './B.vue';
</script>
Both import A from './A.vue';
and import B from './B.vue';
will be added to the pageScripts set. Internally, a Set
is used to ensure uniqueness.
The plugin does not interfere with frontmatter or other Markdown content:
---
title: Frontmatter Example
---
<script import>
import C from './C.vue';
</script>
# Header
Some content here.
The plugin processes the <script import>
block while leaving the frontmatter intact.
Run the unit tests with Vitest
:
pnpm test
In case this README falls out of date, please refer to the documentation for the latest information.
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
A markdown-it plugin for handling imports in markdown files.
We found that @md-plugins/md-plugin-imports demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.