Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

remark-mark-highlight

widcardw5kMIT0.1.1TypeScript support: included

Thanks to remark-gfm

remark, highlight text

readme

remark-mark-highlight

Thanks to remark-gfm

A plugin that can transform ==text== into <mark>text</mark>.

I prefer to use this plugin in Astro to highlight the marked text.

Usage

This package is ESM only. In Node.js (version 12.20+, 14.14+, or 16.0+), install the plugin with npm/yarn/pnpm

npm i -D remark-mark-highlight

Import

import { remarkMark } from 'remark-mark-highlight'
// https://astro.build/config
export default defineConfig({
  // ...
  markdown: {
    remarkPlugins: [remarkMark],
    //              ^^^^^^^^^^
  },
})

Add css

mark {
  background-color: rgba(255, 255, 0, 0.5);
}