Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexmark interferes with KaTeX code #593

Open
1 of 7 tasks
mtrevisan opened this issue Sep 19, 2023 · 0 comments
Open
1 of 7 tasks

Flexmark interferes with KaTeX code #593

mtrevisan opened this issue Sep 19, 2023 · 0 comments

Comments

@mtrevisan
Copy link

It seems that flexmark processes text inside KaTeX code, and I have to pre-process the text to add backslashes and removes
in order to render KaTeX correctly.
What am I doing wrong?

The code I'm using is as simple as

private static Parser PARSER;
private static HtmlRenderer RENDERER;
static{
	MutableDataSet options = new MutableDataSet()
		.set(HtmlRenderer.SOFT_BREAK, "<br />\n");

	PARSER = Parser.builder(options)
		.build();
	RENDERER = HtmlRenderer.builder(options)
		.build();
}

and

Node document = PARSER.parse(content);
String html = RENDERER.render(document);

Please provide as much information about where the bug is located or what you were using:

  • Parser
  • HtmlRenderer
  • Formatter
  • FlexmarkHtmlParser
  • DocxRenderer
  • PdfConverterExtension
  • extension(s)

To reproduce the problem:

public static void main(String[] args){
	String input = """
$$
alpha[\%]
$$
		""";
	System.out.println(RENDERER.render(PARSER.parse(input)));
}

output:

<p>$$<br />
alpha[%]<br />
$$</p>

output expected:

<p>$$
alpha[\%]
$$</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant