AoBane 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/AoBane.gemspec +1 -1
- data/lib/AoBane.rb +11 -7
- data/lib/AoBane/utilities.rb +15 -12
- data/lib/AoBane/version.rb +1 -1
- data/test/Test.html +17 -37
- data/test/Test.md +7 -2
- data/test/test2.md +3 -0
- metadata +5 -4
data/AoBane.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["set"]
|
10
10
|
spec.email = ["set.minami@gmail.com"]
|
11
11
|
spec.description = %q{AoBane The Markdown engine powered by BlueFeather}
|
12
|
-
spec.summary = %q{You can
|
12
|
+
spec.summary = %q{You can generate complex HTML with simple way.}
|
13
13
|
spec.homepage = "https://github.com/setminami/AoBane"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
data/lib/AoBane.rb
CHANGED
@@ -50,10 +50,11 @@ require 'uri'
|
|
50
50
|
require 'AoBane/utilities'
|
51
51
|
require 'math_ml/string'
|
52
52
|
|
53
|
+
|
53
54
|
module AoBane
|
54
|
-
VERSION = '0.1.
|
55
|
-
VERSION_NUMBER = 0.
|
56
|
-
RELEASE_DATE = '2013-04-
|
55
|
+
VERSION = '0.1.14'
|
56
|
+
VERSION_NUMBER = 0.0114
|
57
|
+
RELEASE_DATE = '2013-04-24'
|
57
58
|
VERSION_LABEL = "#{VERSION} (#{RELEASE_DATE})"
|
58
59
|
|
59
60
|
UTF8_BOM = "\xef\xbb\xbf"
|
@@ -662,6 +663,7 @@ module AoBane
|
|
662
663
|
text = Utilities::abbrPostProcess(text)
|
663
664
|
#Insert by set.minami 2013-03-30
|
664
665
|
text = Utilities::insertTimeStamp(text)
|
666
|
+
|
665
667
|
#output = text.split("\n")
|
666
668
|
specialChar = {
|
667
669
|
"\-\-" => "—",
|
@@ -696,7 +698,7 @@ module AoBane
|
|
696
698
|
|
697
699
|
entry = '\-\-|<=>|<\->|\->|<\-|=>|<=|\|\^|\|\|\/|\|\/|\^|\>\>|\<\<|\+_|!=|~~|~=|>_|<_|\|FA|\|EX|\|=|\(+\)|\(x\)|\(c\)|\(R\)|\(SS\)|\(TM\)|!in'
|
698
700
|
|
699
|
-
if text =~ /<pre>/ then
|
701
|
+
if text =~ /<pre>/i then
|
700
702
|
text.gsub!(/<\/pre>(.*?)<pre>/i){|m|
|
701
703
|
if m.nil? then '<\/pre><pre>'
|
702
704
|
else
|
@@ -715,8 +717,10 @@ module AoBane
|
|
715
717
|
m.gsub!(/#{entry}/,specialChar).to_s + '<pre>'
|
716
718
|
end
|
717
719
|
}
|
718
|
-
else
|
719
|
-
text.
|
720
|
+
else
|
721
|
+
if text.nil? then ''
|
722
|
+
else text.gsub!(/#{entry}/,specialChar)
|
723
|
+
end
|
720
724
|
end
|
721
725
|
#return output.join("\n")
|
722
726
|
#Insert by set.minami
|
@@ -729,7 +733,7 @@ module AoBane
|
|
729
733
|
# return values are extended. (mainly for testing)
|
730
734
|
def parse_text_with_render_state(str, rs = nil)
|
731
735
|
rs ||= RenderState.new
|
732
|
-
|
736
|
+
html = parse_text(str, rs)
|
733
737
|
|
734
738
|
return [html, rs]
|
735
739
|
end
|
data/lib/AoBane/utilities.rb
CHANGED
@@ -17,9 +17,12 @@ $MAX_H = 6
|
|
17
17
|
@@log.level = Logger::WARN
|
18
18
|
###Insert Timestamp#################################################################
|
19
19
|
def insertTimeStamp(text)
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
if /\$date/i =~ text then
|
21
|
+
text.gsub!(/\$date/i){
|
22
|
+
getNowTime
|
23
|
+
}
|
24
|
+
else text
|
25
|
+
end
|
23
26
|
end
|
24
27
|
###get Now Timestamp#################################################################
|
25
28
|
def getNowTime
|
@@ -185,15 +188,15 @@ end #def postPailing
|
|
185
188
|
return h*times + number + str
|
186
189
|
end #def
|
187
190
|
|
188
|
-
module_function
|
189
|
-
module_function
|
190
|
-
module_function
|
191
|
-
module_function
|
192
|
-
module_function
|
193
|
-
module_function
|
194
|
-
module_function
|
195
|
-
module_function
|
196
|
-
module_function
|
191
|
+
module_function:getNowTime
|
192
|
+
module_function:insertTimeStamp
|
193
|
+
module_function:abbrPreProcess
|
194
|
+
module_function:abbrPostProcess
|
195
|
+
module_function:storeAbbr
|
196
|
+
module_function:calcSectionNo
|
197
|
+
module_function:prePaling
|
198
|
+
module_function:isDigit
|
199
|
+
module_function:postPaling
|
197
200
|
#############################################################################
|
198
201
|
end
|
199
202
|
|
data/lib/AoBane/version.rb
CHANGED
data/test/Test.html
CHANGED
@@ -8,54 +8,34 @@
|
|
8
8
|
|
9
9
|
<ul>
|
10
10
|
<li><a href="#bfheader-0cbc6611f5540bd0809a388dc95a615b" rel="toc">Test</a>
|
11
|
-
<
|
12
|
-
<li><a href="#bfheader-2cd9f015fe27b13fc5f030d5b95b3189" rel="toc">2. →1.</a>
|
13
|
-
<ul>
|
14
|
-
<li><a href="#bfheader-3c67c325e074b58e6cc60dd385f34ccb" rel="toc">2.2. →1.1.</a></li>
|
15
|
-
<li><a href="#bfheader-b2eecf475e4f6ba162a0decf67a51ae3" rel="toc">2.3. →1.2.</a>
|
16
|
-
<ul>
|
17
|
-
<li><a href="#bfheader-1ecc4a5bf359318abc1cfe734fc0248d" rel="toc">2.3.2. →1.2.1.</a></li>
|
18
|
-
<li><a href="#bfheader-2565b708fb1638163bc9efb407ac6ca3" rel="toc">2.3.3. →1.2.2.</a></li>
|
19
|
-
</ul></li>
|
20
|
-
<li><a href="#bfheader-4053345277cc30d02578bed19dbabbde" rel="toc">2.4. →1.3.</a></li>
|
21
|
-
</ul></li>
|
22
|
-
<li><a href="#bfheader-e4f1b74034f9691eb3bac704b9b8ea29" rel="toc">3. →2.</a>
|
23
|
-
<ul>
|
24
|
-
<li><a href="#bfheader-acbd18db4cc2f85cedef654fccc4a4d8" rel="toc">foo</a></li>
|
25
|
-
</ul></li>
|
26
|
-
</ul></li>
|
11
|
+
* <a href="#bfheader-acbd18db4cc2f85cedef654fccc4a4d8" rel="toc">foo</a></li>
|
27
12
|
</ul>
|
28
13
|
|
29
14
|
<h1 id="bfheader-0cbc6611f5540bd0809a388dc95a615b">Test</h1>
|
30
15
|
|
31
|
-
<
|
32
|
-
|
33
|
-
<p>aa >> «</p>
|
34
|
-
|
35
|
-
<h2 id="bfheader-2cd9f015fe27b13fc5f030d5b95b3189">2. →1.</h2>
|
16
|
+
<p>aaaaaa</p>
|
36
17
|
|
37
|
-
<
|
38
|
-
|
39
|
-
<h3 id="bfheader-b2eecf475e4f6ba162a0decf67a51ae3">2.3. →1.2.</h3>
|
40
|
-
|
41
|
-
<h4 id="bfheader-1ecc4a5bf359318abc1cfe734fc0248d">2.3.2. →1.2.1.</h4>
|
42
|
-
|
43
|
-
<h4 id="bfheader-2565b708fb1638163bc9efb407ac6ca3">2.3.3. →1.2.2.</h4>
|
44
|
-
|
45
|
-
<h3 id="bfheader-4053345277cc30d02578bed19dbabbde">2.4. →1.3.</h3>
|
46
|
-
|
47
|
-
<p>abcdefg</p>
|
18
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><mi>x</mi><mo stretchy='false'>=</mo><mfrac><mrow><mo stretchy='false'>-</mo><mi>b</mi><mo stretchy='false'>±</mo><msqrt><mrow><msup><mi>b</mi><mn>2</mn></msup><mo stretchy='false'>-</mo><mn>4</mn><mi>a</mi><mi>c</mi></mrow></msqrt></mrow><mrow><mn>2</mn><mi>a</mi></mrow></mfrac></math>
|
48
19
|
|
49
|
-
<
|
20
|
+
<p>aa » «</p>
|
50
21
|
|
51
|
-
<
|
22
|
+
<ol>
|
23
|
+
<li><p>→1.
|
24
|
+
2.% →1.1.
|
25
|
+
3.% →1.2.
|
26
|
+
4.%% →1.2.1.
|
27
|
+
5.%% →1.2.2.
|
28
|
+
6.% →1.3.
|
29
|
+
abcdefg</p></li>
|
30
|
+
<li><p>→2.
|
31
|
+
abccccc</p></li>
|
32
|
+
</ol>
|
52
33
|
|
53
|
-
<div style="border:2px solid gray ;
|
34
|
+
<div style="border:2px solid gray ;width:300px;line-height:100%;border-radius:10px;">
|
54
35
|
|
55
36
|
<h3 id="bfheader-acbd18db4cc2f85cedef654fccc4a4d8">foo</h3>
|
56
37
|
|
57
|
-
<p>bar
|
58
|
-
|
38
|
+
<p>bar<br />
|
59
39
|
</div>
|
60
40
|
|
61
41
|
<p><font color="#ff0000" face="" size="5">foo</font></p>
|
data/test/Test.md
CHANGED
data/test/test2.md
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: AoBane
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: math_ml
|
@@ -81,6 +81,7 @@ files:
|
|
81
81
|
- lib/AoBane/version.rb
|
82
82
|
- test/Test.html
|
83
83
|
- test/Test.md
|
84
|
+
- test/test2.md
|
84
85
|
homepage: https://github.com/setminami/AoBane
|
85
86
|
licenses:
|
86
87
|
- MIT
|
@@ -105,8 +106,8 @@ rubyforge_project:
|
|
105
106
|
rubygems_version: 1.8.23
|
106
107
|
signing_key:
|
107
108
|
specification_version: 3
|
108
|
-
summary: You can
|
109
|
-
way.
|
109
|
+
summary: You can generate complex HTML with simple way.
|
110
110
|
test_files:
|
111
111
|
- test/Test.html
|
112
112
|
- test/Test.md
|
113
|
+
- test/test2.md
|