AoBane 0.1.13 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
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 write colored font without css and special characters with simple way.}
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.13'
55
- VERSION_NUMBER = 0.0113
56
- RELEASE_DATE = '2013-04-23'
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.gsub!(/#{entry}/,specialChar)
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
- html = parse_text(str, rs)
736
+ html = parse_text(str, rs)
733
737
 
734
738
  return [html, rs]
735
739
  end
@@ -17,9 +17,12 @@ $MAX_H = 6
17
17
  @@log.level = Logger::WARN
18
18
  ###Insert Timestamp#################################################################
19
19
  def insertTimeStamp(text)
20
- text.gsub!(/\$date/i){
21
- getNowTime
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 :getNowTime
189
- module_function :insertTimeStamp
190
- module_function :abbrPreProcess
191
- module_function :abbrPostProcess
192
- module_function :storeAbbr
193
- module_function :calcSectionNo
194
- module_function :prePaling
195
- module_function :isDigit
196
- module_function :postPaling
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
 
@@ -1,3 +1,3 @@
1
1
  module AoBane
2
- VERSION = "0.1.13"
2
+ VERSION = "0.1.14"
3
3
  end
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
- <ul>
12
- <li><a href="#bfheader-2cd9f015fe27b13fc5f030d5b95b3189" rel="toc">2. &rarr;1.</a>
13
- <ul>
14
- <li><a href="#bfheader-3c67c325e074b58e6cc60dd385f34ccb" rel="toc">2.2. &rarr;1.1.</a></li>
15
- <li><a href="#bfheader-b2eecf475e4f6ba162a0decf67a51ae3" rel="toc">2.3. &rarr;1.2.</a>
16
- <ul>
17
- <li><a href="#bfheader-1ecc4a5bf359318abc1cfe734fc0248d" rel="toc">2.3.2. &rarr;1.2.1.</a></li>
18
- <li><a href="#bfheader-2565b708fb1638163bc9efb407ac6ca3" rel="toc">2.3.3. &rarr;1.2.2.</a></li>
19
- </ul></li>
20
- <li><a href="#bfheader-4053345277cc30d02578bed19dbabbde" rel="toc">2.4. &rarr;1.3.</a></li>
21
- </ul></li>
22
- <li><a href="#bfheader-e4f1b74034f9691eb3bac704b9b8ea29" rel="toc">3. &rarr;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
- <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'>&pm;</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>
32
-
33
- <p>aa >> &laquo;</p>
34
-
35
- <h2 id="bfheader-2cd9f015fe27b13fc5f030d5b95b3189">2. &rarr;1.</h2>
16
+ <p>aaaaaa</p>
36
17
 
37
- <h3 id="bfheader-3c67c325e074b58e6cc60dd385f34ccb">2.2. &rarr;1.1.</h3>
38
-
39
- <h3 id="bfheader-b2eecf475e4f6ba162a0decf67a51ae3">2.3. &rarr;1.2.</h3>
40
-
41
- <h4 id="bfheader-1ecc4a5bf359318abc1cfe734fc0248d">2.3.2. &rarr;1.2.1.</h4>
42
-
43
- <h4 id="bfheader-2565b708fb1638163bc9efb407ac6ca3">2.3.3. &rarr;1.2.2.</h4>
44
-
45
- <h3 id="bfheader-4053345277cc30d02578bed19dbabbde">2.4. &rarr;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'>&pm;</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
- <h2 id="bfheader-e4f1b74034f9691eb3bac704b9b8ea29">3. &rarr;2.</h2>
20
+ <p>aa &raquo; &laquo;</p>
50
21
 
51
- <p>abccccc</p>
22
+ <ol>
23
+ <li><p>&rarr;1.
24
+ 2.% &rarr;1.1.
25
+ 3.% &rarr;1.2.
26
+ 4.%% &rarr;1.2.1.
27
+ 5.%% &rarr;1.2.2.
28
+ 6.% &rarr;1.3.
29
+ abcdefg</p></li>
30
+ <li><p>&rarr;2.
31
+ abccccc</p></li>
32
+ </ol>
52
33
 
53
- <div style="border:2px solid gray ; width:300px;border-radius:10px;">
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 </p>
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
@@ -1,10 +1,14 @@
1
- {nrange:h2-h5;2}
2
- {nrange:h2-h6}
1
+
3
2
  {toc:h1-h6}
3
+
4
4
  Test
5
5
  ===
6
+
7
+ aaaaaa
6
8
  \TeX{x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\TeX}
9
+
7
10
  aa >> <<
11
+
8
12
  % ->1.
9
13
 
10
14
  %% ->1.1.
@@ -30,3 +34,4 @@ abccccc
30
34
 
31
35
  *[foo](#ff0000/5)
32
36
 
37
+
data/test/test2.md ADDED
@@ -0,0 +1,3 @@
1
+
2
+ Test
3
+ ===
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.13
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-23 00:00:00.000000000 Z
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 write colored font without css and special characters with simple
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