commonmarker-rouge 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f2d7482d2e0c5a47e20eb907765080128f91ab3
4
- data.tar.gz: 60f42f343d12babbb9e7c13d21ae5d207d969c1c
3
+ metadata.gz: f3a0bbfe05d0f119e91121a31b087445435e5996
4
+ data.tar.gz: 6e89591531d48758724eb0ec0e82953d57da987b
5
5
  SHA512:
6
- metadata.gz: a9a4b020662d975972b57b6c21e3af6ae2675ab02b56ac4764feda4ed3c920fa6ad8bb45bb7ed15276693867220d4c5a163a948b1867de9e1813abd689557bdc
7
- data.tar.gz: 8d3e11e5a0327f07348755afd339ae2afa2cfe5dd1144f6286746942cbe18e50604cb79e89c8a65aa55003488def04fe487145a334836f53398b7b64be062316
6
+ metadata.gz: cc5b8b8cf1d531dea462b7be0f8f201598d50596f46de8f9ae15ece3dbb5121e09da5fb1724c6047204cbc15802032e37a353d8285db283b87cb6060e4b6d443
7
+ data.tar.gz: f0e0fbccb43f220234f191831f7284536286d4ba90bd1084461dd2d9eb35d1fea908c09d7e45aee327bd3f345d1b1e54abb1995dd2436e76f06f5b22f7691b79
@@ -1,11 +1,9 @@
1
1
  language: ruby
2
2
  dist: trusty
3
3
  rvm:
4
- - '2.0.0'
5
- - '2.1.10'
6
- - '2.2.6'
7
- - '2.3.3'
8
- - '2.4.0'
4
+ - '2.0'
5
+ - '2.4'
6
+ - '2.5'
9
7
  - ruby-head
10
8
  before_install: gem install bundler
11
9
  script: bundle exec rspec && if [ -d coverage ]; then bundle exec codeclimate-test-reporter; fi
@@ -0,0 +1,53 @@
1
+ # Changelog
2
+
3
+ ## 1.5.0
4
+
5
+ *December 01, 2018*
6
+
7
+ * Added support for extensions and render options ([#3])
8
+ * Fixed incompatibility with commonmarker 0.18
9
+ * commonmarker 0.18 is now required
10
+
11
+ ## 1.4.0
12
+
13
+ *September 26, 2017*
14
+
15
+ * `:formatter` option now accepts formatter instance, for formatter class use `:formatter_class`.
16
+ Class argument for `:formatter` is deprecated and will be removed in 2.0
17
+ * fix `render_html` not properly accepting options
18
+
19
+ ## 1.3.0
20
+
21
+ *September 26, 2017*
22
+
23
+ * Allow Rouge 3.*
24
+
25
+ ## 1.2.0
26
+
27
+ *June 09, 2017*
28
+
29
+ * Add language-%fence_info% to highlighter-rouge div wrapper ([#2])
30
+ * Allow using Rouge 2.x
31
+
32
+ ## 1.1.0
33
+
34
+ *May 24, 2017*
35
+
36
+ * Fixed incompatibility with commonmarker >= 0.14.5 ([#1])
37
+ * commonmarker >= 0.14.5 is now required
38
+
39
+ ## 1.0.1
40
+
41
+ *November 17, 2016*
42
+
43
+ * Relax commonmarker requirement
44
+
45
+ ## 1.0.0
46
+
47
+ *April 05, 2016*
48
+
49
+ * Initial release
50
+
51
+ [#1]: https://github.com/sandfoxme/commonmarker-rouge/pull/1
52
+ [#2]: https://github.com/sandfoxme/commonmarker-rouge/pull/2
53
+ [#3]: https://github.com/sandfoxme/commonmarker-rouge/pull/3
data/README.md CHANGED
@@ -2,13 +2,19 @@
2
2
 
3
3
  [![Gem](https://img.shields.io/gem/v/commonmarker-rouge.svg?maxAge=2592000)](https://rubygems.org/gems/commonmarker-rouge)
4
4
  [![Travis](https://img.shields.io/travis/sandfoxme/commonmarker-rouge.svg?maxAge=2592000)](https://travis-ci.org/sandfoxme/commonmarker-rouge)
5
- [![Code Climate](https://img.shields.io/codeclimate/github/sandfoxme/commonmarker-rouge.svg?maxAge=2592000)](https://codeclimate.com/github/sandfoxme/commonmarker-rouge)
6
- [![Code Climate](https://img.shields.io/codeclimate/coverage/github/sandfoxme/commonmarker-rouge.svg?maxAge=2592000)](https://codeclimate.com/github/sandfoxme/commonmarker-rouge/coverage)
7
- [![Gemnasium](https://img.shields.io/gemnasium/sandfoxme/commonmarker-rouge.svg?maxAge=2592000)](https://gemnasium.com/sandfoxme/commonmarker-rouge)
5
+ [![Code Climate](https://img.shields.io/codeclimate/maintainability/sandfoxme/commonmarker-rouge.svg?maxAge=2592000)](https://codeclimate.com/github/sandfoxme/commonmarker-rouge)
6
+ [![Code Climate](https://img.shields.io/codeclimate/c/sandfoxme/commonmarker-rouge.svg?maxAge=2592000)](https://codeclimate.com/github/sandfoxme/commonmarker-rouge/coverage)
8
7
 
9
8
  A [CommonMarker](https://rubygems.org/gems/commonmarker) wrapper with
10
9
  syntax highlight support by [Rouge](https://rubygems.org/gems/rouge).
11
10
 
11
+ ## IMPORTANT
12
+
13
+ `commonmarker-rouge` currently works only with renderer in `:UNSAFE` mode.
14
+ Don't forget to set `:UNSAFE` manually if you're overwriting the renderer mode.
15
+
16
+ If you know how to fix this behavior please comment in [Issue #5](https://github.com/sandfoxme/commonmarker-rouge/issues/5)
17
+
12
18
  ## Installation
13
19
 
14
20
  Add these lines to your application's Gemfile:
@@ -27,7 +33,7 @@ CommonMarker::Rouge.render_html(content)
27
33
  CommonMarker::Rouge.render_doc(content)
28
34
 
29
35
  # pass options to CommonMarker
30
- CommonMarker::Rouge.render_html(content, [:SAFE, :SOURCEPOS])
36
+ CommonMarker::Rouge.render_html(content, [:SOURCEPOS])
31
37
 
32
38
  # use custom CommonMarker wrapper (must provide compatible render_doc)
33
39
  CommonMarker::Rouge.render_html(content, cmark_class: CommonMarkerWrapper)
@@ -4,4 +4,5 @@ require 'bundler/setup'
4
4
  require 'commonmarker/rouge'
5
5
 
6
6
  require 'pry'
7
+
7
8
  Pry.start
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.required_ruby_version = '>= 2.0.0'
22
22
 
23
- spec.add_dependency 'commonmarker', '>= 0.14.5', '< 1.0'
23
+ spec.add_dependency 'commonmarker', '>= 0.18.0', '< 1.0'
24
24
  spec.add_dependency 'rouge', '>= 1.10', '< 4'
25
25
 
26
26
  spec.add_development_dependency 'bundler', '~> 1.11'
@@ -8,16 +8,17 @@ module CommonMarker
8
8
  module Rouge
9
9
  module_function
10
10
 
11
- def render_doc(text, cmark_options = :DEFAULT, **cmr_options)
11
+ def render_doc(text, cmark_options = :DEFAULT, extensions = [], **cmr_options)
12
12
  cmark = cmr_options[:cmark_class] || ::CommonMarker
13
13
 
14
- ast = cmark.render_doc(text, cmark_options)
14
+ ast = cmark.render_doc(text, cmark_options, extensions)
15
15
  process_ast(ast, cmr_options)
16
16
  ast
17
17
  end
18
18
 
19
- def render_html(text, cmark_options = :DEFAULT, **cmr_options)
20
- render_doc(text, cmark_options, **cmr_options).to_html
19
+ def render_html(text, cmark_options = :DEFAULT, render_options = :UNSAFE, extensions = [], **cmr_options)
20
+ doc = render_doc(text, cmark_options, extensions, **cmr_options)
21
+ doc.to_html(render_options)
21
22
  end
22
23
 
23
24
  def process_ast(ast, cmr_options)
@@ -1,5 +1,5 @@
1
1
  module CommonMarker
2
2
  module Rouge
3
- VERSION = '1.4.0'
3
+ VERSION = '1.5.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commonmarker-rouge
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Smirnov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-26 00:00:00.000000000 Z
11
+ date: 2018-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commonmarker
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.14.5
19
+ version: 0.18.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '1.0'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.14.5
29
+ version: 0.18.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '1.0'
@@ -144,6 +144,7 @@ files:
144
144
  - ".gitignore"
145
145
  - ".rspec"
146
146
  - ".travis.yml"
147
+ - CHANGELOG.md
147
148
  - Gemfile
148
149
  - LICENSE.md
149
150
  - README.md