Align any element (right, left, center, justify). Plugin for the markdown-it parser
❗⠀This plugin belongs to a family of experimental features called Jotdoc: a "flavor" of Markdown aiming to maximize readability and extend markup for common use cases where verbose HTML is required.
If you're interested, please do share your thoughts and check out the monorepo!
For inline content, a single >
or <
aligns right or left, respectively.
A >...<
pair centers:
|
Inline |
For blocks of content, pairs are necessary:
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
const md = require('markdown-it')()
md.use(require('@jotdoc/align'), { /* OPTIONS */ })
Center images and <h1>
titles by default:
...
const align = require('@jotdoc/align')
md.use(align), {h1Center: false, imgCenter: true})