Skip to content

dbolack-ab/marked-aligned-paragraphs

Repository files navigation

marked-aligned-paragraphs

Add paragraph alignment attributes to paragraphs using HTML base left, right, and center.

Left Alignment / Ragged Right

Left-alignment is set by preceeding the paragraph with :-

:- This is my parapgraph.

Right Alignment / Ragged Left

Right-alignment is set by preceeding the paragraph with -:

-: This is my parapgraph.

Center Alignment

Center-alignment is set by preceeding the paragraph with :-:

:-: This is my parapgraph.

Usage

const marked = require("marked");
const markedAlignedParagraphs = require("marked-justified-paragraphs");

marked.use({ extensions: [markedAlignedParagraphs] });

const html = marked.parse(":-: This is a center justified paragraph.");
console.log(html);
// <p align="center">This is a center justified paragraph.</p>

About

Paragraph level justification for Marked.js

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published