Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

Commit

Permalink
version 0.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
nkcr committed Nov 18, 2015
1 parent 2d74e3e commit a687cc0
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 87 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,16 @@
## 0.3.3 (2015-11-18)
Minor fix for center tag. Now we don't have to add returns.
Now :
```
->
Text
<-
```
Before:
```
->
Text
<-
```
85 changes: 44 additions & 41 deletions Gemfile.lock
@@ -1,48 +1,48 @@
PATH
remote: .
specs:
simple_markdown (0.3.2)
simple_markdown (0.3.3)
rails (>= 4.2.0)

GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.1)
actionpack (= 4.2.1)
actionview (= 4.2.1)
activejob (= 4.2.1)
actionmailer (4.2.5)
actionpack (= 4.2.5)
actionview (= 4.2.5)
activejob (= 4.2.5)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.1)
actionview (= 4.2.1)
activesupport (= 4.2.1)
actionpack (4.2.5)
actionview (= 4.2.5)
activesupport (= 4.2.5)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.1)
actionview (4.2.1)
activesupport (= 4.2.1)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.5)
activesupport (= 4.2.5)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.1)
activejob (4.2.1)
activesupport (= 4.2.1)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.5)
activesupport (= 4.2.5)
globalid (>= 0.3.0)
activemodel (4.2.1)
activesupport (= 4.2.1)
activemodel (4.2.5)
activesupport (= 4.2.5)
builder (~> 3.1)
activerecord (4.2.1)
activemodel (= 4.2.1)
activesupport (= 4.2.1)
activerecord (4.2.5)
activemodel (= 4.2.5)
activesupport (= 4.2.5)
arel (~> 6.0)
activesupport (4.2.1)
activesupport (4.2.5)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
arel (6.0.0)
arel (6.0.3)
builder (3.2.2)
coveralls (0.8.1)
json (~> 1.8)
Expand All @@ -54,47 +54,47 @@ GEM
domain_name (0.5.24)
unf (>= 0.0.5, < 1.0.0)
erubis (2.7.0)
globalid (0.3.5)
globalid (0.3.6)
activesupport (>= 4.1.0)
http-cookie (1.0.2)
domain_name (~> 0.5)
i18n (0.7.0)
json (1.8.2)
loofah (2.0.2)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.3)
mime-types (>= 1.16, < 3)
mime-types (2.5)
mini_portile (0.6.2)
minitest (5.6.1)
minitest (5.8.2)
netrc (0.10.3)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
rack (1.6.1)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.1)
actionmailer (= 4.2.1)
actionpack (= 4.2.1)
actionview (= 4.2.1)
activejob (= 4.2.1)
activemodel (= 4.2.1)
activerecord (= 4.2.1)
activesupport (= 4.2.1)
rails (4.2.5)
actionmailer (= 4.2.5)
actionpack (= 4.2.5)
actionview (= 4.2.5)
activejob (= 4.2.5)
activemodel (= 4.2.5)
activerecord (= 4.2.5)
activesupport (= 4.2.5)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.1)
railties (= 4.2.5)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.6)
rails-dom-testing (1.0.7)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.2)
loofah (~> 2.0)
railties (4.2.1)
actionpack (= 4.2.1)
activesupport (= 4.2.1)
railties (4.2.5)
actionpack (= 4.2.5)
activesupport (= 4.2.5)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.4.2)
Expand All @@ -107,9 +107,9 @@ GEM
json (~> 1.8)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
sprockets (3.1.0)
rack (~> 1.0)
sprockets-rails (2.3.1)
sprockets (3.4.0)
rack (> 1, < 3)
sprockets-rails (2.3.3)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (>= 2.8, < 4.0)
Expand All @@ -132,3 +132,6 @@ DEPENDENCIES
coveralls
simple_markdown!
sqlite3 (>= 1.3.10)

BUNDLED WITH
1.10.6
90 changes: 48 additions & 42 deletions coverage/.resultset.json
Expand Up @@ -72,68 +72,70 @@
1,
null,
1,
null,
1,
1,
1,
null,
null,
1,
35,
35,
35,
35,
35,
78,
36,
36,
36,
36,
36,
82,
null,
35,
36,
null,
35,
35,
36,
36,
null,
null,
1,
null,
1,
96,
11,
50,
112,
24,
52,
1,
1,
49,
51,
7,
42,
44,
4,
38,
5,
40,
6,
null,
33,
34,
null,
null,
null,
1,
33,
33,
103,
37,
34,
34,
106,
38,
null,
13,
14,
20,
null,
null,
33,
33,
34,
34,
null,
null,
1,
37,
37,
37,
37,
37,
38,
37,
37,
37,
37,
38,
38,
38,
38,
39,
38,
38,
38,
38,
null,
null,
1,
Expand Down Expand Up @@ -177,8 +179,8 @@
null,
3,
null,
22,
8,
29,
15,
null,
7,
7,
Expand All @@ -192,13 +194,13 @@
null,
null,
1,
5,
5,
20,
10,
6,
6,
27,
15,
null,
5,
5,
6,
6,
null,
null,
null,
Expand Down Expand Up @@ -521,9 +523,13 @@
1,
null,
null,
1,
1,
null,
null,
null
]
},
"timestamp": 1431893372
"timestamp": 1447851552
}
}
6 changes: 4 additions & 2 deletions lib/simple_markdown/action_view/helpers.rb
Expand Up @@ -20,6 +20,8 @@ module Helpers
BOLD = /\*\*([^\*]*)\*\*/
RETURN = /\s{2,}$/

END_OF_P = Regexp.union(USELESS_LINE,CENTER_BLOCK_2)

@text_map
@io
@current
Expand Down Expand Up @@ -61,10 +63,10 @@ def parse_block
def parse_p
begin
@io << "<p>\n"
while(!@text_map.peek.match(USELESS_LINE)) # end paragraph if empty line
while(!@text_map.peek.match(END_OF_P)) # end paragraph if empty line
parse_normal
end
@text_map.next;
@text_map.next if !@text_map.peek.match(END_OF_P);
rescue StopIteration
# do nothing
ensure
Expand Down
2 changes: 1 addition & 1 deletion lib/simple_markdown/version.rb
@@ -1,3 +1,3 @@
module SimpleMarkdown
VERSION = "0.3.2"
VERSION = "0.3.3"
end
2 changes: 1 addition & 1 deletion simple_markdown.gemspec
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.description = "Given a markdown formated text, transforms it to html via a simple method `simple_markdown`"
s.license = "MIT"

s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
s.test_files = Dir["test/**/*"]

s.add_dependency 'rails', '>= 4.2.0'
Expand Down
4 changes: 4 additions & 0 deletions test/simple_markdown_test.rb
Expand Up @@ -121,4 +121,8 @@ class SimpleMarkdownTest < ActiveSupport::TestCase # ActionView::TestCase
assert_equal "<center>\n<h1>Title</h1>\n</center>", simple_markdown("->\n#Title\n<-")
end

test "center" do
assert_equal "<center>\n<p>\nNous fêtons nouvel an en famille !\n</p>\n</center>", simple_markdown("->\nNous fêtons nouvel an en famille !\n<-")
end

end

0 comments on commit a687cc0

Please sign in to comment.