pettanr_simple_format 0.0.14 → 0.0.15

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13eaf668bad2d6bdd021a09b2a74de8cb18c68cc
4
- data.tar.gz: 908acf82e969eda110ec57921a6cb0115895ada3
3
+ metadata.gz: e2445f046853cdb055e3d8e7bd039a4e83163bc2
4
+ data.tar.gz: eff8257750f8863c7e0926d789369061ecec4770
5
5
  SHA512:
6
- metadata.gz: 98f8487e8990e1168b9cf5d7acaea0957646e5c91b856887690f9a2d81c00d490acca6203ff1b471be1f882e347dab0f31606dbf1022142e775f369f9acdee93
7
- data.tar.gz: 1829160f21c126a27d3e5193eccde9eeb5107608ef385b9c585ad27952246098e68d927be1b946ebdc3af6a2edd833b5c05204b3d43a54f8dec3221dcafb010b
6
+ metadata.gz: be609c5246932d09204605111cd17cdf8ffbe41b3e726b98a7cc4f60886e47f9c57d95023f794dd38f2d70c280237ecef9f00b7b24b42d8f88f89e509c9cf7da
7
+ data.tar.gz: 54eed4e7d836870c4a7c001cda61019293dd5cfa34ae975b622ab71b4d011e88fc695dcd514272c4d72c670027b65a57444591005fc3882b73e8cdc0cc60927a
@@ -1,19 +1,4 @@
1
1
  module PettanrSimpleFormat
2
2
  class Renderer
3
- def self.render content
4
- self.simple_format(content)
5
- end
6
-
7
- def self.simple_format text
8
- #text = Sanitize.clean(text.to_s, Sanitize::Config::RESTRICTED)
9
- text = ERB::Util.html_escape(text.to_s)
10
- start_tag = '<p>'
11
- text.gsub!(/\r\n?/, "\n")
12
- text.gsub!(/\n\n+/, "</p>\n\n#{start_tag}") # 2+ newline -> paragraph
13
- text.gsub!(/([^\n]\n)(?=[^\n])/, '\1<br />') # 1 newline -> br
14
- text.insert 0, start_tag
15
- text.concat("</p>")
16
- text
17
- end
18
3
  end
19
4
  end
@@ -7,7 +7,8 @@ module PettanrSimpleFormat
7
7
  end
8
8
 
9
9
  def render_simple_format text
10
- text = Sanitize.clean(text.to_s, Sanitize::Config::RESTRICTED)
10
+ #text = Sanitize.clean(text.to_s, Sanitize::Config::RESTRICTED)
11
+ text = ERB::Util.html_escape(text.to_s)
11
12
  start_tag = '<p>'
12
13
  text.gsub!(/\r\n?/, "\n")
13
14
  text.gsub!(/\n\n+/, "</p>\n\n#{start_tag}") # 2+ newline -> paragraph
@@ -1,3 +1,3 @@
1
1
  module PettanrSimpleFormat
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pettanr_simple_format
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - yasushiito
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-29 00:00:00.000000000 Z
11
+ date: 2015-10-31 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This software is a WritingFormat plugin for PettanR
14
14
  email:
@@ -38,7 +38,8 @@ files:
38
38
  - lib/tasks/pettanr_simple_format.rake
39
39
  - lib/tasks/pettanr_simple_format_tasks.rake
40
40
  homepage: https://github.com/yasushiito/pettanr_simple_format/wiki
41
- licenses: []
41
+ licenses:
42
+ - BSD-3-Clause
42
43
  metadata: {}
43
44
  post_install_message:
44
45
  rdoc_options: []