klaro-client 0.5.6 → 0.7.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
  SHA256:
3
- metadata.gz: 3e82871ec2a932573304a87dd1b95d3c8cd0a3bcbbc3716f9e5cc078f2cebb50
4
- data.tar.gz: b26f00ca41e2d1d0e1efa7b2cee647e085b58f5752c8661c978ed48994f5080d
3
+ metadata.gz: 42126059ba59e044d7d25c44aa0a9d86769071ffcea570c564b7e9ddaa0b92c8
4
+ data.tar.gz: 0af95727702d75a8a7830b920efcd36b43def5642461b46aed86419b9ca71e16
5
5
  SHA512:
6
- metadata.gz: cd41f3a9b4883e60b8aa21b4503f49b7007a7d4e89f7c7d9d90e2a2ae852ab73587290cd8258a2e886f3e90d5eacbcc0008636beadfa73fd7e4d8b6ea0bc1766
7
- data.tar.gz: 726d3e81ead2cab64c9fcea8debfb4c63e52638ced761278f303a9ee0c67789e3a1311d0085113f7cc4e28074f882738e2687ccc266bb4a596d3da4b3479182e
6
+ metadata.gz: a99dbe5bcfba816260d8e68a0174ab48f688b00fa28b98356060fb34ab32e96b97694c402477347b81cb01b56d10fa6f7df0efb2da3d470678fc49ca303ae4f5
7
+ data.tar.gz: b360ded9145f755cca8249181ffd65eb5c5ee103b061b70ee439ee9703e79262c2f1cf58ae734487ee7e88b47c08c88cf9f914094eb29454bf6721450e528aa2
@@ -3,37 +3,28 @@ module Klaro
3
3
  class MdText
4
4
 
5
5
  SHARED_OPTIONS = {
6
- filter_html: true,
7
- no_links: false,
8
- no_styles: true,
9
- safe_links_only: true,
10
- with_toc_data: false
11
- }
12
-
13
- VARIANTS = {
14
- :summary => Redcarpet::Markdown.new(
15
- Redcarpet::Render::HTML.new(SHARED_OPTIONS.merge({
16
- hard_wrap: true,
17
- }))
18
- ),
19
- :details => Redcarpet::Markdown.new(
20
- Redcarpet::Render::HTML.new(SHARED_OPTIONS.merge({
21
- hard_wrap: false,
22
- }))
23
- )
6
+ unsafe: false,
24
7
  }
25
8
 
26
9
  def initialize(src, variant)
27
10
  @src = src
28
- @renderer = VARIANTS[variant]
11
+ @variant = variant
29
12
  end
30
13
 
31
14
  def to_s
32
15
  @src
33
16
  end
34
17
 
18
+ def render_options
19
+ SHARED_OPTIONS.merge({
20
+ hardbreaks: (@variant == :summary)
21
+ })
22
+ end
23
+
35
24
  def to_html
36
- @renderer.render(to_s).strip.gsub(/<a href/, '<a target="_blank" href')
25
+ Commonmarker.to_html(to_s, options: {
26
+ render: render_options
27
+ }).strip.gsub(/<a href/, '<a target="_blank" href')
37
28
  end
38
29
 
39
30
  end # class MdText
@@ -2,8 +2,8 @@ module Klaro
2
2
  class Client
3
3
  module Version
4
4
  MAJOR = 0
5
- MINOR = 5
6
- TINY = 6
5
+ MINOR = 7
6
+ TINY = 0
7
7
  end
8
8
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
9
9
  end # class Client
data/lib/klaro/client.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'http'
2
2
  require 'path'
3
- require 'redcarpet'
3
+ require 'commonmarker'
4
4
  require 'i18n'
5
5
 
6
6
  module Klaro
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klaro-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - enspirit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-11 00:00:00.000000000 Z
11
+ date: 2023-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv
@@ -28,30 +28,42 @@ dependencies:
28
28
  name: http
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '5.0'
34
+ - - "<"
32
35
  - !ruby/object:Gem::Version
33
- version: '4.2'
36
+ version: '6.0'
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - "~>"
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '5.0'
44
+ - - "<"
39
45
  - !ruby/object:Gem::Version
40
- version: '4.2'
46
+ version: '6.0'
41
47
  - !ruby/object:Gem::Dependency
42
- name: redcarpet
48
+ name: commonmarker
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
- - - "~>"
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0.26'
54
+ - - "<"
46
55
  - !ruby/object:Gem::Version
47
- version: 3.5.1
56
+ version: '1.0'
48
57
  type: :runtime
49
58
  prerelease: false
50
59
  version_requirements: !ruby/object:Gem::Requirement
51
60
  requirements:
52
- - - "~>"
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0.26'
64
+ - - "<"
53
65
  - !ruby/object:Gem::Version
54
- version: 3.5.1
66
+ version: '1.0'
55
67
  - !ruby/object:Gem::Dependency
56
68
  name: i18n
57
69
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +84,14 @@ dependencies:
72
84
  requirements:
73
85
  - - "~>"
74
86
  - !ruby/object:Gem::Version
75
- version: '2.0'
87
+ version: '2.1'
76
88
  type: :development
77
89
  prerelease: false
78
90
  version_requirements: !ruby/object:Gem::Requirement
79
91
  requirements:
80
92
  - - "~>"
81
93
  - !ruby/object:Gem::Version
82
- version: '2.0'
94
+ version: '2.1'
83
95
  - !ruby/object:Gem::Dependency
84
96
  name: rspec
85
97
  requirement: !ruby/object:Gem::Requirement
@@ -148,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
160
  - !ruby/object:Gem::Version
149
161
  version: '0'
150
162
  requirements: []
151
- rubygems_version: 3.1.6
163
+ rubygems_version: 3.3.26
152
164
  signing_key:
153
165
  specification_version: 4
154
166
  summary: Klaro Client