New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to generating HTML ourselves #99
Conversation
Rebased. |
This will require a lot more checking ... :-) |
The blahtex support code has been simplified to no longer cache mathml in an unbounded file-based cache, and it no longer writes tempfiles. The extremely simple XML parsing job has been handed back over to REXML.
I added in some fixes to remove the itex2mml and blahtex Nokogiri dependencies. Blahtex looked like it was pretty broken, so I put in some tests and go it working again. |
And now S5 is cleaned up too. |
Your "blahtex" output looks like MathML to me. |
Maruku 0.6.1 would notice if a single header encompassed the entire document, and would make that the root section of the document, as well as setting the title to that header's content. This restores that functionality.
This change switches to using the HTML output utilities to generate S5 slides. It also restores the STDOUT printing of slide titles that current Maruku does, but only from the CLI (it won't annoy users who programmatically generate slides).
Thanks, @distler, I'll endeavour to correct my mistakes. Speaking of which, the TOC generation change affected output, so I rewrote that commit to include modified tests. |
Also, I have no experience with blahtex - I thought the point was for it to output MathML when you use the |
The library was designed to do either (output mathml or png's), at the flip of a switch. (It was originally written as a proposed replacement for texvc in MediaWiki. The idea was that Wikipedia could continue generating png's for math, as it currently does and then, at some point in the future, flip a switch and start generating MathML instead. Blahtex never found favour with the MediaWiki people, so development sorta languished.) In Maruku, Blahtex has mostly been used to output png's (for those who don't want/can't handle MathML). The PNG output is a little hard to test properly
But that's what's actually used, in practice, so it's what we want to test. |
OK, sure, it's definitely worth testing the PNG output. My changes simply fix the MathML output (when In other news, this |
I assume this is a problem with the JRuby version? I have never seen that under MRI. |
Nope, this is 1.6.0 under Ruby 2.0.0. Check it out: sparklemotion/nokogiri#961 |
…is actually broken.
I think I'm too tired to keep hammering on this tonight. I've gotten it so it either preserves case on that attribute, or preserves math entities in the document, but not both. Even when I switch |
Hmm, now I see the problem - I confused |
That's not even entirely it - adding |
Its partner is |
That makes sense. Do you know where |
Sure (since I wrote it). It's in |
…cludes a doctype. This preserves both the case of attributes and any named entity references from MathML.
This also extends the tests for issue #40 and squashes a bunch of bugs around CDATA, mostly using hacks.
OK, I think I have this thing licked. After switching to parsing fragments as a full document with a DOCTYPE, we preserve named entites and the case of attributes. What do you think? |
Maruku's output should definitely use either unicode characters or NCRs (rather than named entities). |
Also, I'm surprised that the presence or absence of a DOCTYPE declaration makes a difference. |
Yeah, it's a pretty weird way to fix it. Let me know what it looks like running on your documents and I'll merge. |
No hurry, but let me know when this is good to merge. |
Manually merged. |
Changes Unknown when pulling 5ce7c41 on string-html into * on master*. |
Switch to generating HTML ourselves, without the help of any XML/HTML libraries. This gives us much better direct control of HTML output, makes it much easier to provide consistency across Rubies, removes exposure to Nokogiri bugs, and furthers the goal of removing Nokogiri as a required dependency of Maruku.
@distler, I'm especially interested in how this works in your application, since you seem to really put Maruku through its paces and can probably find some problems that aren't yet in tests.