parpalak / upmath.me

Markdown and LaTeX online editor - create text for web with equations and diagrams
https://upmath.me/
MIT License
323 stars 40 forks source link

latex not properly centralized in the generated html #2

Closed walkerlala closed 7 years ago

walkerlala commented 7 years ago

Hi, I have been using upmath.me for a while, and discover that the latex svg would not be centralized if I copy the generated html and paste it in some other html. Not even a very simple html.

The problem is in this line

<img align="center" src= ...

It turn out this javascript will generate something like:

<p><img align="cener" src=...></p>

for non-inline latex img. But the generated latex img won't be aligned to center.

I don't have much experience in HTML, but with a quick search on google I discover that changing the generated html to this would work:

<p><div style="display: flex; justify-content: center;"><img src=...    ></div></p>

Will this be OK to change the rule in mark-down-it-s2-tex.js ?

parpalak commented 7 years ago

Thanks for reporting. I've fixed it in another way.