remark-unwrap-texts
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.3Β β€’Β PublicΒ β€’Β Published

    πŸ“‹ remark-unwrap-texts

    npm version GitHub license

    Unwraps text nodes in Markdown, is useful when publishing to platforms like DEV.to, Medium, Hashnode, etc. These platforms may not support text wraps and generate unexpected newlines.

    Example

    Before

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam ultricies massa
    ut nisl commodo lacinia. Phasellus convallis in urna eget pharetra. Quisque
    pharetra, odio eget lobortis commodo, orci metus laoreet velit, eget finibus
    orci ipsum laoreet mauris. In vel neque nec augue fringilla porta.

    After

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam ultricies massa ut nisl commodo lacinia. Phasellus convallis in urna eget pharetra. Quisque pharetra, odio eget lobortis commodo, orci metus laoreet velit, eget finibus orci ipsum laoreet mauris. In vel neque nec augue fringilla porta.

    Usage

    Install

    yarn add remark-unwrap-texts

    Configure

    Unified / Remark:

    unified()
      .use(require("remark-parse"))
      .use(require("remark-unwrap-texts"))
      .use(require("remark-stringify"));
    remark().use(require("remark-unwrap-texts"));

    MDX:

    mdx(mdxText, {
      remarkPlugins: [require("remark-unwrap-texts")],
    });

    Made by @phuctm97.

    Install

    npm i remark-unwrap-texts

    DownloadsWeekly Downloads

    16

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    4.53 kB

    Total Files

    7

    Last publish

    Collaborators

    • phuctm97