Comments (3)
I started to implement pasting of math from Wikipedia using a custom ProseMirror ParseRule
(and the .getContent
property), but ran into some unexpected behavior where the pasted math nodes all come up empty. I started a question on the ProseMirror forum which will hopefully resolve the issue.
from prosemirror-math.
This website has math rendered using Madoko, which renders math and diagram SVGs server-side and includes them the following format:
<svg class="snippet math-display math-render-svg math" data-math-full="true" style="..." viewBox="...">
<desc>\begin{tikzpicture}
\matrix[nodes={draw}, row sep=0.3cm,column sep=0.5cm] {
\node [rectangle, draw=none] (eq) {$a = b, b = c, d = e, b = s, d = t: $};&
\node [circle, draw] (abcs) {$a, b, c, s$}; &
\node [circle, draw] (det) {$d, e, t$}; \\
};
\end{tikzpicture}
</desc>
<g id="math-a6e187">...</g>
</svg>
This example contains an SVG rendering of a tikz diagram, which is obviously problematic for KaTeX, which is the current default. Once MathJax is supported, an extension like TikzJax can be used to render diagrams.
UPDATE: It won't be possible to paste from documents rendered with Madoko. The TeX source is contained in a <desc>
tag within an SVG element, and apparently the <desc>
tags are stripped away in both Chrome and Firefox when copying.
from prosemirror-math.
UPDATE: StackExchange keeps its TeX code in <script type="math/tex">
tags, but these are stripped away when copying for security reasons. To copy from StackExchange, we'll need to parse the MathML directly.
from prosemirror-math.
Related Issues (20)
- Specialized Support for Arrays HOT 5
- Undo HOT 1
- Plugin to detect math in pasted LaTeX-like text HOT 1
- Editor loses focus when deleting empty line following math block
- Control+backspace is a text-editing shortcut on Windows to delete words; it should not delete the entire math block in the default config
- Support for async KaTeX HOT 1
- Readonly mode HOT 1
- Console log in production bundle. HOT 1
- Support Tiptap HOT 17
- Preview panel support HOT 4
- MathView throws unknown errors instead of handling them like ParseError HOT 1
- Integration with Outline's `rich-markdown-editor` HOT 12
- Problem with caret position of math_inline in RTL HOT 1
- Usage with TipTap: `Error: inner view should not exist!` HOT 2
- Support snippet HOT 2
- export 'ParseError' (imported as 'ParseError') was not found in 'katex' (possible exports: default) HOT 3
- static HTML for math node views HOT 2
- Pasting math into editor
- Math inline gets in the way of normal sentences. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prosemirror-math.