AoBane 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +0 -2
  2. data/lib/AoBane/version.rb +1 -1
  3. data/lib/AoBane.rb +23 -10
  4. metadata +2 -2
data/README.md CHANGED
@@ -96,8 +96,6 @@ like this
96
96
 
97
97
  > (x) ⊗
98
98
 
99
- > `\&` &
100
-
101
99
  > (c) ©
102
100
 
103
101
  > (R) ®
@@ -1,3 +1,3 @@
1
1
  module AoBane
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
3
3
  end
data/lib/AoBane.rb CHANGED
@@ -51,9 +51,9 @@ require 'AoBane/utilities'
51
51
  require 'math_ml/string'
52
52
 
53
53
  module AoBane
54
- VERSION = '0.1.9'
55
- VERSION_NUMBER = 0.0109
56
- RELEASE_DATE = '2013-04-19'
54
+ VERSION = '0.1.10'
55
+ VERSION_NUMBER = 0.0110
56
+ RELEASE_DATE = '2013-04-20'
57
57
  VERSION_LABEL = "#{VERSION} (#{RELEASE_DATE})"
58
58
 
59
59
  UTF8_BOM = "\xef\xbb\xbf"
@@ -685,14 +685,13 @@ module AoBane
685
685
  "\|=" => "≡",
686
686
  "\(+\)" => "&oplus",
687
687
  "\(x\)" => "⊗",
688
- "\\&" =>"&",
689
688
  "\(c\)" => "©",
690
689
  "\(R\)" =>"®",
691
690
  "\(SS\)" => "§",
692
691
  "\(TM\)" => "™",
693
692
  "!in" => "∉"}
694
693
 
695
- entry = '\-\-|<=>|<\->|\->|<\-|=>|<=|\|\^|\|\|\/|\|\/|\^|\>\>|\<\<|\+_|!=|~~|~=|>_|<_|\|FA|\|EX|\|=|\(+\)|\(x\)|\\&|\(c\)|\(R\)|\(SS\)|\(TM\)|!in'
694
+ entry = '\-\-|<=>|<\->|\->|<\-|=>|<=|\|\^|\|\|\/|\|\/|\^|\>\>|\<\<|\+_|!=|~~|~=|>_|<_|\|FA|\|EX|\|=|\(+\)|\(x\)|\(c\)|\(R\)|\(SS\)|\(TM\)|!in'
696
695
 
697
696
  if text =~ /<pre>/ then
698
697
  text.gsub!(/<\/pre>(.*?)<pre>/i){|m|
@@ -1225,8 +1224,11 @@ module AoBane
1225
1224
  }
1226
1225
  end
1227
1226
 
1227
+ CaptionRegexp = "\\[(.+?)\\](\\{\\#(.+?)\\}){0,1}"
1228
1228
  TableRegexp = %r{
1229
1229
  (?:
1230
+ (#{CaptionRegexp}\s*\n){0,1}
1231
+ # modified by set.minami 2013-04-20
1230
1232
  ^([ ]{0,#{TabWidth - 1}}) # not indented
1231
1233
  (?:[|][ ]*) # NOT optional border
1232
1234
 
@@ -1262,11 +1264,16 @@ module AoBane
1262
1264
  }x
1263
1265
 
1264
1266
  def transform_table_rows(str, rs)
1265
-
1267
+
1266
1268
  # split cells to 2-d array
1267
1269
  data = str.split("\n").map{|x| x.split('|')}
1268
-
1269
-
1270
+ caption = '' #Inserted by set.minami 2013-04-20
1271
+ captionName = ''
1272
+ if /#{CaptionRegexp}/ =~ data[0][0] then
1273
+ caption = if $1.nil? then '' else $1 end
1274
+ captionName = if $3.nil? then '' else $3 end
1275
+ data.slice!(0)
1276
+ end #Inserted by set.minami 2013-04-20
1270
1277
  data.each do |row|
1271
1278
  # cut left space
1272
1279
  row.first.lstrip!
@@ -1277,8 +1284,14 @@ module AoBane
1277
1284
 
1278
1285
  column_attrs = []
1279
1286
 
1280
- re = ''
1281
- re << "<table>\n"
1287
+ re = ''
1288
+ re << if captionName == '' then
1289
+ "<table>\n"
1290
+ else
1291
+ "<table id=\"#{captionName}\">\n"
1292
+ end
1293
+ re << "<caption>#{caption}</caption>\n"
1294
+ #Insert by set.minami 2013-04-20
1282
1295
 
1283
1296
  # head is exist?
1284
1297
  if data.size >= 3 and data[1].all?{|x| x =~ TableSeparatorCellRegexp} then
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.9
4
+ version: 0.1.10
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-18 00:00:00.000000000 Z
12
+ date: 2013-04-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: math_ml