1.0.4 • Published 8 months ago

mathml-to-clipboard v1.0.4

Weekly downloads
5
License
ISC
Repository
github
Last release
8 months ago

A JavaScript code to transform MathML into AsciiMath during "copy" and "dragstart" events. See example.html.

This allows the user to select a part of the rendered MathML on a page, then copy and paste the selection or use drag-and-drop. The selection is serialized to a plain text string as AsciiMath.

The script only handles MathML tags, so MathJax may not always be supported. It works with MathML polyfills, such as https://github.com/fred-wang/mathml.css/ .

Usage:

npm install Yaffle/mathml-to-clipboard
npm run-script build

Then add the script to your html page:

<script src="dist/main.js"></script>

It will set the "copy" and "dragstart" event handlers on the document.

1.0.4

8 months ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago