markdown_views 2.1.3 → 2.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5df0161956a6cf0a692de3844b8eaabd3839c63a3efeb00e4b5253f4003f0339
4
- data.tar.gz: 1a297c19d39d6a69d5111dae58fe7625117a9c2615d52a928a9b68e93d73ddf2
3
+ metadata.gz: 283dffd7e05c826c9afe0001d87a55e1aae253f96c35e40cd41652c08a0263a8
4
+ data.tar.gz: 585759b65f9b16f0087ac9962bb3167a61c3bd46369f7b03be9a7957663291de
5
5
  SHA512:
6
- metadata.gz: f51a26f78fa1e5c559cf7e84e13106bdbbb42e9fc9faa70a29de76bb69a9af277fd0f658b2a4301831c1e619803d05c8bc824e5f1a138d721677a4868e4cc035
7
- data.tar.gz: 33f92ccec6e6c8c3d4134c77fd2fe162b5216703cd797e3d188080a1a989a844abacd22ba865a2d345a577d3df7b94b81725f121ad8e8fdf1159d29247ca68ef
6
+ metadata.gz: cd63063f559443aa1820a4512c75c3af5d95ac663bcf0b25008c945f433f9388e9fdaf4326d2272ba212045e06ca8d70f200ccccaf06c3f78d6f231e1d44155d
7
+ data.tar.gz: e801ab390c61b786aff4451ed3ab889ade60bd6ca1d3dc8f3932eb51a5b39286efdd1ec08967865e927f70d5b0c5527ffcb436213bb86c777046b623a709450e
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2019 thomas morgan
1
+ Copyright (c) 2014-2020 thomas morgan
2
2
 
3
3
  MIT License
4
4
 
@@ -24,8 +24,18 @@ module MarkdownViews
24
24
  MarkdownViews.rouge_opts[:formatter] || Rouge::Formatters::HTML.new
25
25
  end
26
26
 
27
+ # when removing comments, also cleans up leading whitespace.
28
+ # if whitespace includes line feeds, leaves 1 behind to
29
+ # avoid breaking markdown adjacent to comment.
27
30
  def strip_comments(input)
28
- input.gsub(/[ \t\r\n\f]*<!--(.*?)-->*/m, '')
31
+ # (\s*) leading whitespace
32
+ # <!-- start of html comment
33
+ # .*? any char, incl linefeed (for multi-line comments)
34
+ # lazy (non-greedy): *?
35
+ # --> end of html comment
36
+ input.gsub(/(\s*)<!--.*?-->/m) do |match|
37
+ $1 =~ %r{\n} ? "\n" : ''
38
+ end
29
39
  end
30
40
 
31
41
  def transform_code_blocks(doc)
@@ -1,3 +1,3 @@
1
1
  module MarkdownViews
2
- VERSION = '2.1.3'
2
+ VERSION = '2.1.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdown_views
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - thomas morgan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-26 00:00:00.000000000 Z
11
+ date: 2020-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commonmarker