JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8295
  • Score
    100M100P100Q145272F
  • License ISC

A markdown-it plugin to replace leading tabs with spaces in code blocks

Package Exports

  • markdown-it-expand-tabs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (markdown-it-expand-tabs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

markdown-it-expand-tabs

A markdown-it plugin to replace leading tabs with spaces in code blocks

Greenkeeper badge Build Status Code Climate

What it does

  • Replaces leading tabs with spaces in fenced code blocks
  • Nothing else

Why is this useful?

Say you have tab-indented code in a markdown file and you want the rendered code to take up less visual space horizontally. This plugin will help. If you're not in that situation, then this plugin probably isn't for you.

Installation

npm install markdown-it-expand-tabs

Usage

Use it the same as a normal markdown-it plugin:

var md = require('markdown-it');
var expandTabs = require('markdown-it-expand-tabs');

var parser = md().use(expandTabs);

var result = parser.render(...); // markdown string containing tab-indented code blocks

The default behavior is to convert leading tabs into two spaces each. You can choose an alternate tab width thusly:

var parser = md().use(expandTabs, {tabWidth: 4});

Tests

npm install
npm test

License

ISC