-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Extended parsing support for LaTeX #42
Comments
This should already be supported? what result do you get when using displaymath? |
The block math code I have is
It seems that it should use a double dollar |
I have made the previous modification and the math between |
The reason for So for the sake of As for your issue, will it be possible for you to send a copy of the markdown that curse this issue? |
I have the following versions:
Math enabled simple caseThe creation code is
The markdown is
The inline math is rendered by MathJax, but the delimiters Math with dollarsThe creation code is
The markdown is
The double quotes should not be there. Best regards, |
Just a quick question, if you add a extra |
I have tried
|
Can confirm that in Parsedown 2.0 this is no longer a issue :) I will see if I can back forward this to the current version |
I have cloned your repo and switched to version 2, run composer on it. Here is a minimal test HTML code <!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<title>Test Parsedown</title>
</head>
<body>
<h1>Mathjax test</h1>
<div>
\[x(t)=x_{0}+\int_{0}^{t}f(x(s))ds\]
</div>
<h1>Parsedown test</h1>
<?php
require __DIR__.'/vendor/autoload.php';
require 'src/ParsedownExtended.php';
use BenjaminHoegh\ParsedownExtended;
use Erusev\Parsedown\Parsedown;
$Extra = new Parsedown(new ParsedownExtended\ParsedownExtended());
$theHTML = $Extra->toHtml(' \[x(t)=x_{0}+\int_{0}^{t}f(x(s))ds\]');
$theHTML .= '<br>'.$Extra->toHtml(' \(x(t)=x_{0}+\int_{0}^{t}f(x(s))ds\)');
echo '<div>'.$theHTML.'</div>';
?>
</body>
</html>
<?php Mathjax itself renders the displayMath correctly. ParsedownExtended renders the inline Math, but not the display math. By the way, can we use the new ParsedownExtra in this setup? Cheers |
Sorry, didn't see your comment, yes you can use ParsedownExtra, the extension will automatic switch to use ParsedownExtra as base |
Is your feature request related to a problem? Please describe.
I appreciate the LaTeX support. It lets KaTeX or MathJax process inline equations, starting with
\(
and ending with\)
. It would be nice to be able to display displaymath equations, i.e. code starting with\[
and ending\]
.Describe the solution you'd like
When
math
is set to true, let the\[
and\]
be passed to the HTML code for the LaTeX interpreter to use them.The text was updated successfully, but these errors were encountered: