obsidianmd / obsidian-clipper

Highlight and capture the web in your favorite browser. The official Web Clipper extension for Obsidian.
https://obsidian.md/clipper
MIT License
1.02k stars 46 forks source link

BUG: Detect multiline, aline, and so on. #143

Open ras0q opened 5 days ago

ras0q commented 5 days ago

Version (please complete the following information):

Describe the bug A clear and concise description of what the bug is. If applicable, add screenshots to help explain your problem.

In this plugin, MathJax blocks are parsed into LaTeX and imported into Obsidian enclosed in $ or $$, but multi-line equations are not displayed correctly.

To reproduce Steps to reproduce the behavior:

  1. Open https://mathjax.github.io/MathJax-demos-web/equation-numbers.html
  2. Click the extension button and clip the page
  3. Equations display will be corrupted.

Expected behavior A clear and concise description of what you expected to happen.

For the following equation,

image

I expect the extension to parse below.

$$
\begin{align*}
a_{1} & = b_{1} + c_{1} \\ a_{2} & = b_{2} + c_{2} - d_{2} + e_{2}
\end{align*}
$$

image

Actual behavior

$$
a_{1} & = b_{1} + c_{1} \\ a_{2} & = b_{2} + c_{2} - d_{2} + e_{2}
$$

image

Your template file Go to your template in Web Clipper settings and click on "Export". Attach the JSON file here, or paste the content below.

kepano commented 3 days ago

Your change via #142 is in 0.9.6

ras0q commented 3 days ago

142 is not directly related to this issue.

Some of these expressions do not render correctly in Obsidian even though they are recognized as math blocks. I understand that some of this is due to the limitations of the mathml-to-latex package, but it would be helpful to have minimal support for multilines, alignments, etc.

kepano commented 3 days ago

Ok the should be more clarity in the difference with #121