Support TeX-style math equations via MathJax.

This commit is contained in:
Tom Preston-Werner
2010-07-25 22:40:09 -07:00
parent 9ccb84f8d8
commit d37d57596b
384 changed files with 39493 additions and 4 deletions
+12
View File
@@ -291,6 +291,18 @@ context "Markup" do
compare(content, output, 'org')
end
test "tex block syntax" do
content = 'a \[ a^2 \] b'
output = "<p>a <script type=\"math/tex; mode=display\">a^2</script> b</p>"
compare(content, output, 'md')
end
test "tex inline syntax" do
content = 'a \( a^2 \) b'
output = "<p>a <script type=\"math/tex\">a^2</script> b</p>"
compare(content, output, 'md')
end
def compare(content, output, ext = "md", regexes = [])
index = @wiki.repo.index
index.add("Bilbo-Baggins.#{ext}", content)