0.24.0 • Published 4 years ago

@xmark/transform-wrap-headings v0.24.0

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

@xmark/transform-wrap-headings

Wrap flat html tag list (from markdown ast) with section divs for different levels

Usage

const XMark = require('@xmark/core');
const TransformWrapHeadings = require('@xmark/transform-wrap-headings');

const xmark = XMark();

xmark.useTransform(TransformWrapHeadings, {
  parseAttributes: true,
  parseStyleAttributes: true,
  wrapperTag: 'section',
  enabledHeadings: ['h1'],
  wrapperClasses: {
    wrapper: 'section',
    modifier: x => `section--level${x}`,
  },
});

const markdown = '# heading 1';
const hast = xmark.toHAST(markdown);
const html = xmark.toHTML(markdown);
0.24.0

4 years ago

0.23.1

4 years ago

0.22.0

4 years ago

0.21.0

4 years ago

0.20.0

5 years ago

0.19.0

5 years ago

0.18.0

5 years ago

0.17.0

5 years ago

0.16.0

5 years ago

0.15.0

5 years ago

0.14.0

5 years ago

0.13.0

5 years ago

0.12.0

5 years ago

0.11.0

5 years ago

0.10.0

5 years ago

0.9.1

5 years ago

0.8.0

5 years ago

0.7.0

5 years ago

0.6.0

5 years ago

0.5.0

5 years ago

0.4.1

5 years ago