Skip to content

jsonToMarkdown is not following the best practices for headings #83

@abdumanas-plutoflume

Description

@abdumanas-plutoflume

As per the content stack documentation here and the best practices for Markdowns here, headings shouldn't be followed by a # and there should be a space b/w the hash prefix and the headings. But the jsonToMarkdown is not following those best practices.

For example, the following test should pass but it's not:

const input = {
      type: "doc",
      children: [
        {
          type: "h1",
          children: [{ text: "This is a heading" }],
        },
      ],
    };

    const result = jsonToMarkdown(input);
    expect(result.trim()).toBe("# This is a heading"); // Doesn't pass
    expect(result.trim()).not.toBe("#This is a heading#"); // Doesn't pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions