govuk_markdown 2.0.0b1 → 2.0.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: cf2eeb05a74d3e6dac921b756a58192707d5c4edbb0d706b8d79dbf735dd3279
4
- data.tar.gz: 319c0f2a286dd65829c3b08c93f6a6492748445b82c223b60e8120f4285855f7
3
+ metadata.gz: c6d0bb270e6c3987985f3da0f956b8a9871c112cc09ca232715a2440773cd8ab
4
+ data.tar.gz: 6f34ac1e30578e6c6c912e93fc8c6fd410ace73b73903f7c8141559299832c91
5
5
  SHA512:
6
- metadata.gz: 4ba28fd33999e3201ce352baabd21c5a9f3f9959133401cacf39902b8c97259e3dd7ff4aac71db4de31154546f06b61599705e74cab88555f9c357d4cf760345
7
- data.tar.gz: 90e4c6e7edea3656159d6532452d4bef11f292a0a9682a661ffcb0ea4e31d88c62efc87b22db3135b54852c02bdb0aff223ddec8119934a5f346a8278aa9ef63
6
+ metadata.gz: 02aba1d2ccc9623234849df49f3d3fbf90b4b4c180c8e7496d36ca341af39bf16c6cec9a735981906ed94949b21e192fdc200f92f22596f5740db3cb01404d71
7
+ data.tar.gz: eea2c0cf468653aac44d138fb928292daaaab5fb9d296d1149e6cc28a3ab30a84b2afd7291e47a0ede5a5f5929b5f669a91bc21d5d19adafb7e10cdd6842f75e
data/.gitignore CHANGED
@@ -6,3 +6,4 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ *.gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- govuk_markdown (2.0.0b1)
4
+ govuk_markdown (2.0.0)
5
5
  activesupport
6
6
  redcarpet
7
7
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module GovukMarkdown
2
- VERSION = "2.0.0b1".freeze
2
+ VERSION = "2.0.0".freeze
3
3
  end
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.0b1
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-07 00:00:00.000000000 Z
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: 1.3.1
146
+ version: '0'
147
147
  requirements: []
148
148
  rubygems_version: 3.1.4
149
149
  signing_key: