model_formatting 0.2.3.12 → 0.2.3.13

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/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'rake/testtask'
3
3
 
4
4
  spec = Gem::Specification.new do |s|
5
5
  s.name = "model_formatting"
6
- s.version = "0.2.3.12"
6
+ s.version = "0.2.3.13"
7
7
  s.author = "ENTP"
8
8
  s.email = "company@entp.com"
9
9
  s.homepage = "http://github.com/entp"
@@ -178,11 +178,6 @@ module ModelFormatting
178
178
 
179
179
  def self.gfm(text)
180
180
  extract_tag(text, :pre) do |txt|
181
- # prevent foo_bar_baz from ending up with an italic word in the middle
182
- text.gsub!(/(^(?! {4}|\t)\w+_\w+_\w[\w_]*)/) do |x|
183
- x.gsub('_', '\_') if x.split('').sort.to_s[0..1] == '__'
184
- end
185
-
186
181
  # in very clear cases, let newlines become <br /> tags
187
182
  #text.gsub!(/(\A|^$\n)(^\w[^\n]*\n)(^\w[^\n]*$)+/m) do |x|
188
183
  # x.gsub(/^(.+)$/, "\\1 ")
@@ -105,8 +105,8 @@ class ModelFormattingTest < Test::Unit::TestCase
105
105
  assert_equal "<pre>\nfoo_bar_baz\n</pre>", ModelFormatting.gfm("<pre>\nfoo_bar_baz\n</pre>")
106
106
  end
107
107
 
108
- it "escapes two or more underscores inside words" do
109
- assert_equal "foo\\_bar\\_baz", ModelFormatting.gfm("foo_bar_baz")
108
+ it "does not touch underscores inside words" do
109
+ assert_equal "foo_bar_baz", ModelFormatting.gfm("foo_bar_baz")
110
110
  end
111
111
 
112
112
  it "turns newlines into br tags in simple cases" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_formatting
3
3
  version: !ruby/object:Gem::Version
4
- hash: 75
4
+ hash: 73
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
9
  - 3
10
- - 12
11
- version: 0.2.3.12
10
+ - 13
11
+ version: 0.2.3.13
12
12
  platform: ruby
13
13
  authors:
14
14
  - ENTP
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2013-01-19 00:00:00 Z
19
+ date: 2013-01-23 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: redcarpet