jekyll-absolute-links 0.1.4 → 0.1.5

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: 8330da05ea6e13c0c5aa8c882456208d21387424a200cd19b1143679c413b2aa
4
- data.tar.gz: 88dd920dd88e003dc55a72ff2347e2ff8086b5df7c056304eb91f33c4baf40b0
3
+ metadata.gz: 9438dccca1c6cae71aefdffc21cb2c42be933956f24e029267b40f2b58a1d8b3
4
+ data.tar.gz: 4a3fa0567a6464374aadc2568fc2374aa0309b28e32971904dde1a6f7155cc26
5
5
  SHA512:
6
- metadata.gz: 2231ffdc90914e84c9c25d556a11c7e5246e26509a24a653ba54f8e4b17c4a173de046cc8d660384f657c247a64154ead2438c4dcb8d8d0e5fa3a40e3f5ebb18
7
- data.tar.gz: da907810c6f47f64d339344853e1bb393da1e1bdeca89b45434a80dbaee6fbf96904a3cd151d5a875284b8c03d03cdbf6c0dd95d2b8cdf75cb12e1986c318b6a
6
+ metadata.gz: 39afbec775beeaacbf21f76fca4448cc98b67644d10ac62d805fc24ed611654059dad03cabd378d78af24ffcefcb014836a5825deebe214af48a3c6e4cd869f8
7
+ data.tar.gz: b041a91d17b413dbf959568f0f580bb3cdb10d4df520425b08ee4a7e89eda0c8261a2d86c6a8e336bfa7da0743d65cb81751f83f4cc999903e7bad10bb612b4b
@@ -1,6 +1,6 @@
1
1
  module JekyllAbsoluteLinks
2
2
  class Crawler
3
- @regexp = %r{<code[\S\s]*?/code>|(?<="|'|>|=|&quot;|&apos;|&gt;|&equals;)(?<url>/[\w/.-]*)(?!>|&gt;)}
3
+ @regexp = %r{<code[\S\s]*?/code>|(?<="|'|>|=|&quot;|&apos;|&gt;|&equals;)(?!//)(?<url>/[\w/.-]*)(?!>|&gt;)}
4
4
 
5
5
  Jekyll::Hooks.register :posts, :post_render do |post|
6
6
  next if Jekyll::env == "development"
@@ -1,3 +1,3 @@
1
1
  module JekyllAbsoluteLinks
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -16,7 +16,7 @@ describe JekyllAbsoluteLinks::Crawler do
16
16
 
17
17
  context "When development environment is active" do
18
18
  describe "Crawler" do
19
- it "performs no link transformation in posts" do
19
+ it "performs no relative link transformation in posts" do
20
20
  a = "<a href=\"/posts/curabitur-sed-condimentum-enim/\">"
21
21
  expect(site.posts[0].output).to include(a)
22
22
  end
@@ -26,6 +26,16 @@ describe JekyllAbsoluteLinks::Crawler do
26
26
  expect(site.posts[0].output).to include(a)
27
27
  end
28
28
 
29
+ it "performs no absolute link transformation in posts" do
30
+ a = "<a href=\"https://jekyllrb.com\">"
31
+ expect(site.posts[0].output).to include(a)
32
+ end
33
+
34
+ it "performs no protocol-relative link transformation in posts" do
35
+ a = "<a href=\"//example.com\">"
36
+ expect(site.posts[0].output).to include(a)
37
+ end
38
+
29
39
  it "performs no link transformation in pages" do
30
40
  a = "<a href=\"/posts/lorem-ipsum-dolor-sit-amet/\">"
31
41
  expect(site.pages[1].output).to include(a)
@@ -122,6 +132,11 @@ eos
122
132
  expect(site.posts[0].output).to include(a)
123
133
  end
124
134
 
135
+ it "performs no link transformation for protocol-relative links" do
136
+ a = "<a href=\"//example.com\">"
137
+ expect(site.posts[0].output).to include(a)
138
+ end
139
+
125
140
  it "performs no link transformation inside inline code snippets" do
126
141
  code = "<code class=\"highlighter-rouge\">/</code>"
127
142
  expect(site.posts[0].output).to include(code)
@@ -25,7 +25,10 @@ egestas, est nibh euismod mauris, quis molestie libero ex in erat.
25
25
  Share on Facebook
26
26
  </a>
27
27
 
28
- Powered by [Jekyll][2]
28
+ Powered by [Jekyll][2].
29
+
30
+ Go [home][3].
29
31
 
30
32
  [1]: /posts/curabitur-sed-condimentum-enim/
31
33
  [2]: https://jekyllrb.com
34
+ [3]: //example.com
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-absolute-links
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Miguel Venegas Mendoza
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-27 00:00:00.000000000 Z
11
+ date: 2018-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll