AoBane 0.1.6 → 0.1.7

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.
Files changed (3) hide show
  1. data/lib/AoBane/version.rb +1 -1
  2. data/lib/AoBane.rb +47 -53
  3. metadata +2 -2
@@ -1,3 +1,3 @@
1
1
  module AoBane
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
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.6'
55
- VERSION_NUMBER = 0.0106
56
- RELEASE_DATE = '2013-04-15'
54
+ VERSION = '0.1.7'
55
+ VERSION_NUMBER = 0.0107
56
+ RELEASE_DATE = '2013-04-17'
57
57
  VERSION_LABEL = "#{VERSION} (#{RELEASE_DATE})"
58
58
 
59
59
  UTF8_BOM = "\xef\xbb\xbf"
@@ -659,60 +659,54 @@ module AoBane
659
659
  text = Utilities::postPaling(text)
660
660
 
661
661
  #Insert by set.minami 2013-03-30
662
- output = []
663
- text.lines {|line|
664
- if /<pre><code>/ =~ line then
665
- output << line
666
- next
667
- until /<\/code><\/pre>/ =~ line
668
- output << line
669
- next
670
- end
671
- else
672
- line.gsub!(/\-\-|<=>|<\->|\->|<\-|=>|<=|\|\^|\|\|\/|\|\/|\^|
662
+ output = text.split("\n")
663
+ output.each_with_index{|line,index|
664
+ if /<\/pre>(.*?)<pre>|(.*)<pre>|<\/pre>(.*)/i =~ line then
665
+ if $1.nil? then ''
666
+ else $1.gsub!(/\-\-|<=>|<\->|\->|<\-|=>|<=|\|\^|\|\|\/|\|\/|\^|
673
667
  \>\>|\<\<|\+_|!=|~~|~=|>_|<_|\|FA|\|EX|\|=|\(+\)|\(x\)|
674
668
  \\&|\(c\)|\(R\)|\(SS\)|\(TM\)|!in/,
675
- "\-\-" => "&mdash;",
676
- "<=" => "&hArr;",
677
- "<\->" => "&harr;",
678
- "\->" =>"&rarr;",
679
- "<\-" =>"&larr;",
680
- "=>" => "&rArr;",
681
- "<=" => "&lArr;",
682
- "\|\|\^" => "&uArr;",
683
- "\|\|\/" => "&dArr;",
684
- "\|\/" => "&darr;",
685
- "\|\^" => "&uarr;",
686
- ">>" => "&raquo;",
687
- "\<\<" => "&laquo;",
688
- "+_" => "&plusmn;",
689
- "!=" => "&ne;",
690
- "~~" => "&asymp;",
691
- "~=" => "&cong;",
692
- "<_" => "&le;",
693
- ">_" => "&ge",
694
- "\|FA" => "&forall;",
695
- "\|EX" => "&exist;",
696
- "\|=" => "&equiv;",
697
- "\(+\)" => "&oplus",
698
- "\(x\)" => "&otimes;",
699
- "\\&" =>"&amp;",
700
- "\(c\)" => "&copy;",
701
- "\(R\)" =>"&reg;",
702
- "\(SS\)" => "&sect;",
703
- "\(TM\)" => "&trade;",
704
- "!in" => "&notin;")
705
- output << line
669
+ "\-\-" => "&mdash;",
670
+ "<=" => "&hArr;",
671
+ "<\->" => "&harr;",
672
+ "\->" =>"&rarr;",
673
+ "<\-" =>"&larr;",
674
+ "=>" => "&rArr;",
675
+ "<=" => "&lArr;",
676
+ "\|\|\^" => "&uArr;",
677
+ "\|\|\/" => "&dArr;",
678
+ "\|\/" => "&darr;",
679
+ "\|\^" => "&uarr;",
680
+ ">>" => "&raquo;",
681
+ "\<\<" => "&laquo;",
682
+ "+_" => "&plusmn;",
683
+ "!=" => "&ne;",
684
+ "~~" => "&asymp;",
685
+ "~=" => "&cong;",
686
+ "<_" => "&le;",
687
+ ">_" => "&ge",
688
+ "\|FA" => "&forall;",
689
+ "\|EX" => "&exist;",
690
+ "\|=" => "&equiv;",
691
+ "\(+\)" => "&oplus",
692
+ "\(x\)" => "&otimes;",
693
+ "\\&" =>"&amp;",
694
+ "\(c\)" => "&copy;",
695
+ "\(R\)" =>"&reg;",
696
+ "\(SS\)" => "&sect;",
697
+ "\(TM\)" => "&trade;",
698
+ "!in" => "&notin;")
699
+ end
706
700
  end
707
- }
701
+ }
708
702
 
709
- return output
710
- #Insert by set.minami
711
- #return text
712
-
713
- end
714
-
715
- alias parse parse_text
703
+ return output.join("\n")
704
+ #Insert by set.minami
705
+ #return text
706
+
707
+ end
708
+
709
+ alias parse parse_text
716
710
 
717
711
  # return values are extended. (mainly for testing)
718
712
  def parse_text_with_render_state(str, rs = nil)
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.6
4
+ version: 0.1.7
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-15 00:00:00.000000000 Z
12
+ date: 2013-04-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: math_ml