Skip to content

When the previous line is a paragraph, the brackets type doesn't work. #54

@aloTu

Description

@aloTu

Not Work

const tm = require("markdown-it-texmath");
const md = require("markdown-it")({ html: true, breaks: true }).use(tm, {
  engine: require("katex"),
  delimiters: ["brackets", "dollars"],
  katexOptions: { macros: { "\\RR": "\\mathbb{R}" } },
});

const str = "#hhh\n\\[\n e^{i\\pi}+1=0\n\\]\n";

console.log(md.render(str));
//<p>#hhh<br>\n[<br>\ne^{i\pi}+1=0<br>\n]</p>

Work

const tm = require("markdown-it-texmath");
const md = require("markdown-it")({ html: true, breaks: true }).use(tm, {
  engine: require("katex"),
  delimiters: ["brackets", "dollars"],
  katexOptions: { macros: { "\\RR": "\\mathbb{R}" } },
});

const str = "# hhh\n\\[\n e^{i\\pi}+1=0\n\\]\n";

console.log(md.render(str));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions