Update to latest HTML5lib, Add Maruku testdir
Sync with the latest html5lib. Having the Maruku unit tests on-hand may be useful for debugging; so let's include them.
This commit is contained in:
parent
ebc409e1a0
commit
1085168bbf
337 changed files with 21290 additions and 72 deletions
34
vendor/plugins/maruku/tests/math/use_itex.rb
vendored
Normal file
34
vendor/plugins/maruku/tests/math/use_itex.rb
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
|
||||
# run this as:
|
||||
# ruby -I../../lib use_itex.rb < private.txt
|
||||
|
||||
require 'maruku'
|
||||
|
||||
module MaRuKu; module Out; module HTML
|
||||
|
||||
def to_html_inline_math_itex
|
||||
# You can: either return a REXML::Element
|
||||
# return Element.new 'div'
|
||||
# or return an empty array on error
|
||||
# return []
|
||||
# or have a string parsed by REXML:
|
||||
tex = self.math
|
||||
tex.gsub!('&','&')
|
||||
mathml = "<code>#{tex}</code>"
|
||||
return Document.new(mathml).root
|
||||
end
|
||||
|
||||
def to_html_equation_itex
|
||||
return to_html_inline_math_itex
|
||||
end
|
||||
|
||||
end end end
|
||||
|
||||
MaRuKu::Globals[:html_math_engine] = 'itex'
|
||||
|
||||
doc = Maruku.new($stdin.read, {:on_error => :raise})
|
||||
|
||||
File.open('output.xhtml','w') do |f|
|
||||
f.puts doc.to_html_document
|
||||
end
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue