govuk_markdown 2.0.0b1 → 2.0.0
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 +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/lib/govuk_markdown/preprocessor.rb +9 -2
- data/lib/govuk_markdown/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c6d0bb270e6c3987985f3da0f956b8a9871c112cc09ca232715a2440773cd8ab
|
|
4
|
+
data.tar.gz: 6f34ac1e30578e6c6c912e93fc8c6fd410ace73b73903f7c8141559299832c91
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 02aba1d2ccc9623234849df49f3d3fbf90b4b4c180c8e7496d36ca341af39bf16c6cec9a735981906ed94949b21e192fdc200f92f22596f5740db3cb01404d71
|
|
7
|
+
data.tar.gz: eea2c0cf468653aac44d138fb928292daaaab5fb9d296d1149e6cc28a3ab30a84b2afd7291e47a0ede5a5f5929b5f669a91bc21d5d19adafb7e10cdd6842f75e
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -10,7 +10,7 @@ module GovukMarkdown
|
|
|
10
10
|
output.gsub!(build_regexp("inset-text")) do
|
|
11
11
|
<<~HTML
|
|
12
12
|
<div class="govuk-inset-text">
|
|
13
|
-
#{Regexp.last_match(1)}
|
|
13
|
+
#{nested_markdown(Regexp.last_match(1))}
|
|
14
14
|
</div>
|
|
15
15
|
HTML
|
|
16
16
|
end
|
|
@@ -29,7 +29,7 @@ module GovukMarkdown
|
|
|
29
29
|
</span>
|
|
30
30
|
</summary>
|
|
31
31
|
<div class="govuk-details__text">
|
|
32
|
-
#{details}
|
|
32
|
+
#{nested_markdown(details)}
|
|
33
33
|
</div>
|
|
34
34
|
</details>
|
|
35
35
|
HTML
|
|
@@ -39,6 +39,13 @@ module GovukMarkdown
|
|
|
39
39
|
|
|
40
40
|
private
|
|
41
41
|
|
|
42
|
+
# parse as markdown if there are multiple lines of content
|
|
43
|
+
def nested_markdown(content)
|
|
44
|
+
return content unless content =~ /\n/
|
|
45
|
+
|
|
46
|
+
GovukMarkdown.render(content)
|
|
47
|
+
end
|
|
48
|
+
|
|
42
49
|
def build_regexp(tag_name, pre_tag: "{", post_tag: "}", closing: "/")
|
|
43
50
|
start_tag = pre_tag + tag_name + post_tag
|
|
44
51
|
end_tag = pre_tag + closing + tag_name + post_tag
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: govuk_markdown
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tijmen Brommet
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-02-
|
|
11
|
+
date: 2023-02-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -141,9 +141,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
141
141
|
version: 2.7.0
|
|
142
142
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
143
|
requirements:
|
|
144
|
-
- - "
|
|
144
|
+
- - ">="
|
|
145
145
|
- !ruby/object:Gem::Version
|
|
146
|
-
version:
|
|
146
|
+
version: '0'
|
|
147
147
|
requirements: []
|
|
148
148
|
rubygems_version: 3.1.4
|
|
149
149
|
signing_key:
|