Giter VIP home page Giter VIP logo

Comments (6)

chrisjsewell avatar chrisjsewell commented on June 10, 2024 1

cool cheers, yep definitely good for you to do the Python one as well 👍 I certainly fee it is key to keep the python/typescript implementations in-sync, so we can work towards this "language agnostic" specification

from markdown-it-amsmath.

rowanc1 avatar rowanc1 commented on June 10, 2024 1

Awesome - I feel like tracing some of these small issues/improvements all the way through will also help me get my bearings in the python stack, and get a better feeling for how everything on that side hangs together.

from markdown-it-amsmath.

welcome avatar welcome commented on June 10, 2024

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

from markdown-it-amsmath.

chrisjsewell avatar chrisjsewell commented on June 10, 2024

Happy to discuss, but just to give my initial thoughts:

This can be overridden through the renderer, however, the default should provide good basics and valid html

IMO the default renderer is literally only there for testing purposes, it should never actually be used in production, i.e. you should always set a renderer.
This is why TBH, when I created https://github.com/executablebooks/mdit-py-plugins/tree/master/mdit_py_plugins/amsmath, I really did not put too much thought into it, except the fact that I wanted to capture exactly what had been passed in the render, so that the tests were good

In the previous js implementation of this, we were adding a \[ before and after the div, this allowed the default script of mathjax and katex to render when this HTML was output.

I very much don't think this is how this package should be used. In sphinx we have to have mathjax search for the math, because (the javascript implemented) mathjax can not be accessed via the Python API. There are issues around this, e.g.:

  • Its slow because mathjax has to walk through the whole HTML syntax tree to find math, that we have already identified via markdown-it
  • It can potentially mis-intepret text as math, if e.g. the content was backslash esaped then markdown-it removes those escapes

with this package, we have "proper" API access to these packages, and do not need to go through an intermediary.

from markdown-it-amsmath.

chrisjsewell avatar chrisjsewell commented on June 10, 2024

note as well any changes here would also have to mirrored in https://github.com/executablebooks/mdit-py-plugins/tree/master/mdit_py_plugins/amsmath

from markdown-it-amsmath.

rowanc1 avatar rowanc1 commented on June 10, 2024

It seems like if we tweak the basic template and update the tests, then this will be fine to use in production (the render later approach) - and that seems like a better test suite anyways and not much work. I will add a few other tests that make use of the HTML sanitizing.

Agree on the \[. Makes enough sense to loop on known nodes rather than a text lookup. It was me using the default mathjax/katex renderer.

Will start a PR here and then open one on the python repo.

from markdown-it-amsmath.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.