Skip to content

Striping <br> joins newlines in markdown output #83

@carloslenz

Description

@carloslenz

Initial checklist

Affected package

[email protected]

Steps to reproduce

import rehypeParse from "rehype-parse";
import rehypeRemark from "rehype-remark";
import remarkStringify from "remark-stringify";
import { unified } from "unified";

const processor = unified()
  .use(rehypeParse)
  .use(rehypeRemark)
  .use(remarkStringify, {
    fences: true,
  });

const main = async () => {
  const vfile = await processor.process(`<p>A<span><br /><span>B</p>`);
  console.log("RESULT", vfile.value);
};

main().catch(console.error);

Actual behavior

RESULT AB

Expected behavior

RESULT A\
B

Runtime

No response

Package manager

No response

Operating system

No response

Build and bundle tools

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions