klaro-client 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/klaro/client/support/md_text.rb +11 -20
- data/lib/klaro/client/version.rb +1 -1
- data/lib/klaro/client.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42126059ba59e044d7d25c44aa0a9d86769071ffcea570c564b7e9ddaa0b92c8
|
4
|
+
data.tar.gz: 0af95727702d75a8a7830b920efcd36b43def5642461b46aed86419b9ca71e16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
@
|
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
|
-
|
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
|
data/lib/klaro/client/version.rb
CHANGED
data/lib/klaro/client.rb
CHANGED
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.
|
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: 2023-
|
11
|
+
date: 2023-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -45,25 +45,25 @@ dependencies:
|
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '6.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
48
|
+
name: commonmarker
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '0.26'
|
54
54
|
- - "<"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '
|
56
|
+
version: '1.0'
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: '
|
63
|
+
version: '0.26'
|
64
64
|
- - "<"
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: '
|
66
|
+
version: '1.0'
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: i18n
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
160
|
- !ruby/object:Gem::Version
|
161
161
|
version: '0'
|
162
162
|
requirements: []
|
163
|
-
rubygems_version: 3.
|
163
|
+
rubygems_version: 3.3.26
|
164
164
|
signing_key:
|
165
165
|
specification_version: 4
|
166
166
|
summary: Klaro Client
|