Add paragraph alignment attributes to paragraphs using HTML base left, right, and center.
Left-alignment is set by preceeding the paragraph with :-
:- This is my parapgraph.
Right-alignment is set by preceeding the paragraph with -:
-: This is my parapgraph.
Center-alignment is set by preceeding the paragraph with :-:
:-: This is my parapgraph.
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>