govuk_markdown 0.3.0 → 0.4.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: 6479fefb7a458cfffb3576bdb7b26a0001280c4aeb5451ad41cf8cf591f92d99
4
- data.tar.gz: 0f07eef7eec6c89405192995e0dc16f550ec8b31250a3e337373a90d5e473b49
3
+ metadata.gz: 587d477359637429b19f4b8657940ad42c53ef5d1e7566432c89ded9e08edad3
4
+ data.tar.gz: c52c08b4ce188235ba63c2445e372320cfdaafcd2c7be44faf052e1fec80a05d
5
5
  SHA512:
6
- metadata.gz: 13724c7fb419e7e696ad312146af83da0cd51b984e85f8da9c1ce332fd0bf75bf0a63e1a41f92442875b4d5652c9b7a7bc3aa9f9dd756cf0e9660caf5f67a6c5
7
- data.tar.gz: b8e98b9319f2101fae7faa7eb9b06395e99f1095fc47f1690b27f52d0e9d0c8adddf04ad0911b22f963e7eb8833f5421fd8b08b275ea02be04740c9cc532bd97
6
+ metadata.gz: c1c54cd75ccfab04de4b900c61802a3a36f9b0e525baa36303c5be7f0a859c1cbbf443467a130b5c322f00be3cd511915f03cd07ba272450a5530802d80c2467
7
+ data.tar.gz: 1dc06a438f269eabf63de6bb2baa27ff221ffb019c2dcd990e7122dc8b27fbf77202cf80ced11ce2e204aeef5d090e5c742352b54c05b22126b7324404500fe5
@@ -0,0 +1,10 @@
1
+ # https://gds-way.cloudapps.digital/manuals/programming-languages/editorconfig
2
+ root = true
3
+
4
+ [*.{rb,yml}]
5
+ indent_size = 2
6
+ indent_style = space
7
+ charset = utf-8
8
+ end_of_line = lf
9
+ insert_final_newline = true
10
+ trim_trailing_whitespace = true
@@ -1,3 +1,7 @@
1
+ ## 0.4.0
2
+
3
+ This release ensures all links get the `govuk-link` class, no matter which Markdown link syntax is used (#7).
4
+
1
5
  ## 0.3.0
2
6
 
3
7
  This release adds support for tables (#3) and avoids the notorious emphasised `snake_cased_words` issue (#4).
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- govuk_markdown (0.3.0)
4
+ govuk_markdown (0.4.0)
5
5
  activesupport
6
6
  redcarpet
7
7
 
@@ -40,6 +40,10 @@
40
40
  <div class="govuk-width-container">
41
41
  <main class="govuk-main-wrapper" id="main-content" role="main">
42
42
  <h1 id="a-h1-title-header" class="govuk-heading-xl">A h1 title header</h1>
43
+ <h2 id="links" class="govuk-heading-l">Links</h2>
44
+ <p class="govuk-body-m">This is <a href="https://gov.uk" class="govuk-link">linked text</a>.</p>
45
+ <p class="govuk-body-m">This is <a href="https://gov.uk" title="The best place to find government services and information" class="govuk-link">linked text with a title</a>.</p>
46
+ <p class="govuk-body-m">This is a linked URL <a href="https://www.gov.uk/help" class="govuk-link">https://www.gov.uk/help</a> and this is a linked email address <a href="mailto:noreply@gov.uk" class="govuk-link">noreply@gov.uk</a>.</p>
43
47
  <h2 id="lists" class="govuk-heading-l">Lists</h2>
44
48
  <p class="govuk-body-m">This is a list:</p>
45
49
  <ul class="govuk-list govuk-list--bullet">
@@ -1,5 +1,13 @@
1
1
  # A h1 title header
2
2
 
3
+ ## Links
4
+
5
+ This is [linked text](https://gov.uk).
6
+
7
+ This is [linked text with a title](https://gov.uk "The best place to find government services and information").
8
+
9
+ This is a linked URL <https://www.gov.uk/help> and this is a linked email address <noreply@gov.uk>.
10
+
3
11
  ## Lists
4
12
 
5
13
  This is a list:
@@ -6,7 +6,7 @@ require_relative "./govuk_markdown/renderer"
6
6
 
7
7
  module GovukMarkdown
8
8
  def self.render(markdown)
9
- renderer = GovukMarkdown::Renderer.new(with_toc_data: true)
9
+ renderer = GovukMarkdown::Renderer.new(with_toc_data: true, link_attributes: { class: "govuk-link" })
10
10
  Redcarpet::Markdown.new(renderer, tables: true, no_intra_emphasis: true).render(markdown).strip
11
11
  end
12
12
  end
@@ -67,11 +67,6 @@ module GovukMarkdown
67
67
  end
68
68
  end
69
69
 
70
- def link(link, title, content)
71
- title_attribute = title.present? ? " title=\"#{title}\"" : ""
72
- %(<a href="#{link}" class="govuk-link"#{title_attribute}>#{content}</a>)
73
- end
74
-
75
70
  def hrule
76
71
  <<~HTML
77
72
  <hr class="govuk-section-break govuk-section-break--xl govuk-section-break--visible">
@@ -1,3 +1,3 @@
1
1
  module GovukMarkdown
2
- VERSION = "0.3.0".freeze
2
+ VERSION = "0.4.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: 0.3.0
4
+ version: 0.4.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: 2020-11-02 00:00:00.000000000 Z
11
+ date: 2020-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -87,6 +87,7 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - ".editorconfig"
90
91
  - ".github/workflows/publish_gem.yml"
91
92
  - ".github/workflows/tests.yml"
92
93
  - ".gitignore"