mmarkdown 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mmarkdown/version.rb +1 -1
- data/lib/mmarkdown.rb +2 -2
- data/test/test.html +2 -1
- data/test/test.md +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d990b8d6e63571648d6303a66ed508272b67f132
|
4
|
+
data.tar.gz: c46eaad8a0f50ed7fef341349b7299a5de798e5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11290f0c30d6ab56c53f532e59eeaca63b40b357baa10f87c2072164a8804c6b6d731ad78481aa8d07f2199dda2cf94b80ad23a1be5b1ac4bee576b76dcb013f
|
7
|
+
data.tar.gz: 1d033224938323da53c17bd35e9c9d1303e59c8159a8f83016fe773c7b4d046c9b94a91a7ee86477fba5d759ca0300ecf34982d4de401e564677338a65e82ecd
|
data/lib/mmarkdown/version.rb
CHANGED
data/lib/mmarkdown.rb
CHANGED
@@ -34,11 +34,11 @@ class MMarkdown
|
|
34
34
|
equations = []
|
35
35
|
|
36
36
|
string_mathml = string.clone
|
37
|
-
string.scan(/\\\[(
|
37
|
+
string.scan(/\\\[(.*?)\\\]/) {|m|
|
38
38
|
string_mathml.gsub!("\\[" + m.first + "\\]", m.first.to_mathml(true).to_s)
|
39
39
|
}
|
40
40
|
|
41
|
-
string.scan(/\\\((
|
41
|
+
string.scan(/\\\((.*?)\\\)/) {|m|
|
42
42
|
string_mathml.gsub!("\\(" + m.first + "\\)", m.first.to_mathml.to_s)
|
43
43
|
}
|
44
44
|
|
data/test/test.html
CHANGED
@@ -4,7 +4,8 @@
|
|
4
4
|
|
5
5
|
<h2 id="equation">Equation</h2>
|
6
6
|
|
7
|
-
<p>This is an equation
|
7
|
+
<p>This is an equation. <math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><msup><mi>x</mi><mn>2</mn></msup><mo stretchy='false'>+</mo><msup><mi>y</mi><mn>2</mn></msup><mo stretchy='false'>=</mo><msup><mi>r</mi><mn>2</mn></msup></math>,
|
8
|
+
(<math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><mi>x</mi><mo stretchy='false'>=</mo><mi>r</mi><mi>cos</mi><mi>θ</mi></math> and <math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><mi>y</mi><mo stretchy='false'>=</mo><mi>r</mi><mi>sin</mi><mi>θ</mi></math>).</p>
|
8
9
|
|
9
10
|
<p>And this is the second
|
10
11
|
<math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><msup><mi>sin</mi><mn>2</mn></msup><mi>θ</mi><mo stretchy='false'>+</mo><msup><mi>cos</mi><mn>2</mn></msup><mi>θ</mi><mo stretchy='false'>=</mo><mn>1</mn></math>.</p>
|
data/test/test.md
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mmarkdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroyuki Tanaka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redcarpet
|