breaks()

text में newlines को `<br>` elements में convert करें।

import { breaks } from "@unifast/node";

Signature

function breaks(): UnifastPlugin

Parameters

कोई नहीं।

उपयोग

import { compile, breaks } from "@unifast/node";

const md = `This is line one.
This is line two.
This is line three.`;

const result = compile(md, {
  plugins: [breaks()],
});
// प्रत्येक newline एक <br> element बन जाता है

उदाहरण

Newlines से line breaks तक

breaks() के बिना, ये तीन lines एक ही paragraph में merge हो जातीं। plugin enable होने पर, प्रत्येक newline एक <br> बन जाता है: