remark-quote-cite
v0.1.2
Published
A remark plugin to add `cite` attribute to `<blockquote>`.
Maintainers
Readme
remark-quote-cite
A remark plugin to add cite attribute to <blockquote>.
Install
npm i remark-quote-citeUsage
For example:
import { describe, expect, it } from 'bun:test';
import rehypeStringify from 'rehype-stringify';
import remarkParse from 'remark-parse';
import remarkQuoteCite from 'remark-quote-cite';
import remarkRehype from 'remark-rehype';
import { unified } from 'unified';
const process = (markdown: string): string => {
const file = unified()
.use(remarkParse)
.use(remarkQuoteCite)
.use(remarkRehype)
.use(rehypeStringify)
.processSync(markdown);
return String(file).trim();
};Write Markdown like below.
> A simple system for adding formatting to plain text.
> cite: <https://markdown.org/>will be:
<blockquote cite="https://markdown.org/">
<p>A simple system for adding formatting to plain text.
</blockquote>In GFM, auto links are also effective.
Note it doesn't validate URLs.
Config
unified.use(remarkQuoteCite, options?)options = { label?: string }
label is recognized as mark before cite link. cite: is default. Don't include trailing spaces like link: .
