Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

markdown-it-ruby

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-it-ruby

Ruby annotation plugin for markdown-it parser.

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

markdown-it-ruby

NPM version

Ruby annotations (<ruby>) tag plugin for markdown-it markdown parser.

{ruby base|ruby text} => <ruby>ruby base<rt>ruby text</rt></ruby>

Markup is based on DenDenMarkdown definition.

Install

npm install markdown-it-ruby --save

Usage

import MarkdownIt from 'markdown-it';
import rubyPlugin from 'markdown-it-ruby';

const md = new MarkdownIt().use(rubyPlugin);
md.render('{ruby base|ruby text}'); // => '<p><ruby>ruby base<rt>ruby text</rt></ruby></p>'

CommonJS

const MarkdownIt = require('markdown-it');
const rubyPlugin = require('markdown-it-ruby');

const md = new MarkdownIt().use(rubyPlugin);
md.render('{ruby base|ruby text}'); // => '<p><ruby>ruby base<rt>ruby text</rt></ruby></p>'

Options

You can pass options to the plugin:

const md = new MarkdownIt().use(rubyPlugin, {
  rp: ['(', ')'] // Add parentheses around ruby text
});

// Output: <ruby>漢字<rp>(</rp><rt>かんじ</rt><rp>)</rp></ruby>
md.render('{漢字|かんじ}');
Available Options
OptionTypeDefaultDescription
rp[string, string]['', '']Array of opening and closing parentheses to wrap around ruby text. When both values are empty strings, no rp elements will be output.

License

MIT

Keywords

FAQs

Package last updated on 07 Nov 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc