Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add basic math editing features #2038

Merged
merged 2 commits into from

7 participants

@rgaiacs

This solve bug 945228.

Note: This is based on @fred-wang's Javascript (La)TeX to MathML parser that has a Firefox Add-ons that have been revised already.

This add a plugin for CKEditor that add basic math editing features based on (La)TeX input.

You can test it here using kuma's version of CKEditor and here using CKEditor4.

There are at least two "minor bugs" that are related with kuma's version of CKEditor. You can find more information about it here and here.

Raniere Silva Add CKEditor-TeXZilla plugin
Link to CKEditor-TeXZilla: https://github.com/r-gaia-cs/CKEditor-TeXZilla

For this commit it was used c4e484c7f9fd71f5f313892a3da2919ee2b14722
4984e66
@groovecoder
Owner

Thanks for the pull request! @darkwing and/or @openjck should check this out. And maybe @elchi3 since he has a working kuma box and has done some of the MathML editing on MDN.

@darkwing
Owner

This is good from a code perspective but since @elchi3 is a world renowned MathML expert, I'd like him to see if this is useful.

@icaaq

texzilla.js has some warnings (52) if I run it thru http://www.jshint.com/

@darkwing
Owner

Unfortunately every CKEditor plugin will. One lesson I've learned is that you never modify the original code of an external library or plugin, so as long as it works and there are no security issues, I think we're fine.

@icaaq

missing semicolon could at least be fixed imho :)

@openjck
Owner

One lesson I've learned is that you never modify the original code of an external library or plugin

It looks like Raniere wrote the plugin himself. (Go Raniere!)

I agree it would be nice to pass JSHint. It can be opinionated at times (though not as much as JSLint) but there are usually good reasons for it. Writing JS without J*Lint always feels like walking through a minefield to me. But we might have to agree to disagree on that. :smile:

@fred-wang

Just my two cents on this: the core of the TeX-to-MathML parser is generated from Jison (http://zaach.github.io/jison/docs/). While it is certainly possible to fix the JSLint errors for parts that have been written by hand, I don't think it would be a good idea to try to fix the one generated by Jison (we'll have to do that each time we update the grammar). However, @r-gaia-cs could probably try to fix as many errors as possible...

@rgaiacs

Thanks all for the comments.

@openjck I will run JSLint and fix as many errors as possible.

@Elchi3

I just tested this on my box and it works great. I used some examples from MathJax (http://www.mathjax.org/demos/tex-samples/). The TeX source is stored in the element, so that you can edit the TeX again, once the MathML got generated; very cool! In a spot check, I haven't seen any (JS) errors, so I would say r+ on the functionality.

Some layout ideas (optional, not needed per se):

  • Above the box it could say: "Please insert your (LaTex) code:" and then below the box: "(Clicking outside of the textarea updates the preview)".
  • Maybe the two checkboxes could have a "Options:" caption above and they could be next to each other as there is some room on the right.

Thanks all, happy to see MDN becoming a mathematician and scientists friendly platform!

@groovecoder
Owner

@r-gaia-cs, great work! do you prefer bugzilla bugs or GitHub issues?
@Elchi3, can you file new bugs or GitHub issues for those follow-ups?

@fred-wang

I guess we can use GitHub issues for CKEditor-TeXZilla (I already reported some bugs):
https://github.com/r-gaia-cs/CKEditor-TeXZilla/issues?state=open

@rgaiacs

@groovecoder Since the plugin can be reused on others CKEditors instances I prefer GitHub issues.

@groovecoder
Owner

@Elchi3 - are you good to merge this as-is and to file follow-up issues at https://github.com/r-gaia-cs/CKEditor-TeXZilla/issues?state=open ? I'd like to merge before this bit-rots.

@rgaiacs

@groovecoder, @Elchi3 I have plans to update this PR in a few hours.

@rgaiacs

I update this PR with the last @fred-wang last changes in TeXZilla and others.

@groovecoder
Owner

@Elchi3 - can you check this out again now with these updates?

@Elchi3

r+

@groovecoder groovecoder merged commit f3a5fd8 into mozilla:master

1 check passed

Details default Jenkins build 'mdn-github' #2446 has succeeded
@rgaiacs rgaiacs deleted the rgaiacs:TeXZilla branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 19, 2014
  1. Add CKEditor-TeXZilla plugin

    Raniere Silva authored
    Link to CKEditor-TeXZilla: https://github.com/r-gaia-cs/CKEditor-TeXZilla
    
    For this commit it was used c4e484c7f9fd71f5f313892a3da2919ee2b14722
Commits on Feb 25, 2014
  1. Update based on version 1.0

    Raniere Silva authored
Something went wrong with that request. Please try again.