middleman-core 4.3.4 → 4.3.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7df898ff16a53b3953c34bb2a83e40cce779ea5fa25cf5e7b05e6f11cf5baaa5
|
4
|
+
data.tar.gz: 4ed72925a0a1e7f47543a0cee16e9476a0b28b3143bd8778470d5d789d36ddc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b216de6348ba80aa66c8ee53ab04d4b727eabc6b5a4aaea397b36cacba4c2a3c93d2381097947c599caaaf081609616059dcc5a85bf3f6f31ccb5911f2eb6624
|
7
|
+
data.tar.gz: '09016ce934947d803b6dcdc9259d7e91f1acfa195892fa0cc9654e11a2190e2efb87914bb28943f9820cd270d8dd20e7b4b0d8520fc2e165460db283532a840b'
|
@@ -178,6 +178,7 @@ Feature: i18n Paths
|
|
178
178
|
|
179
179
|
Current: <%= url_for "/article.html" %>
|
180
180
|
Other: <%= url_for "/article.html", locale: ::I18n.locale == :en ? :es : :en %>
|
181
|
+
Current with anchor: <%= url_for "/article.html", :anchor => "test-anchor" %>
|
181
182
|
"""
|
182
183
|
And a file named "source/localizable/article.es.html.erb" with:
|
183
184
|
"""
|
@@ -185,6 +186,7 @@ Feature: i18n Paths
|
|
185
186
|
|
186
187
|
Current: <%= url_for "/article.html" %>
|
187
188
|
Other: <%= url_for "/article.html", locale: :en %>
|
189
|
+
Current with anchor: <%= url_for "/article.html", :anchor => "test-anchor" %>
|
188
190
|
"""
|
189
191
|
And a file named "config.rb" with:
|
190
192
|
"""
|
@@ -203,7 +205,9 @@ Feature: i18n Paths
|
|
203
205
|
Then I should see "Page Lang: Default"
|
204
206
|
Then I should see 'Current: /article.html'
|
205
207
|
Then I should see 'Other: /es/article.html'
|
208
|
+
Then I should see 'Current with anchor: /article.html#test-anchor'
|
206
209
|
When I go to "/es/article.html"
|
207
210
|
Then I should see "Page Lang: Spanish"
|
208
211
|
Then I should see 'Current: /es/article.html'
|
209
212
|
Then I should see 'Other: /article.html'
|
213
|
+
Then I should see 'Current with anchor: /es/article.html#test-anchor'
|
@@ -36,3 +36,20 @@ Feature: Markdown (Kramdown) support
|
|
36
36
|
And I should see 'src="/images/blank.gif"'
|
37
37
|
And I should see 'src="/images/blank.gif"'
|
38
38
|
And I should see "mail@mail.com"
|
39
|
+
|
40
|
+
Scenario: Kramdown uses our link_to with options parameter
|
41
|
+
Given a fixture app "markdown-app"
|
42
|
+
And a file named "config.rb" with:
|
43
|
+
"""
|
44
|
+
set :markdown_engine, :kramdown
|
45
|
+
activate :directory_indexes
|
46
|
+
"""
|
47
|
+
And a file named "source/links.html.markdown" with:
|
48
|
+
"""
|
49
|
+
[A link](/smarty_pants.html)
|
50
|
+
[A second link](/smarty_pants.html){: anchor="test-anchor"}
|
51
|
+
"""
|
52
|
+
Given the Server is running at "markdown-app"
|
53
|
+
When I go to "/links/"
|
54
|
+
Then I should see "/smarty_pants/"
|
55
|
+
And I should see "/smarty_pants/#test-anchor"
|
@@ -74,8 +74,12 @@ class Middleman::CoreExtensions::Internationalization < ::Middleman::Extension
|
|
74
74
|
opts = options.dup
|
75
75
|
|
76
76
|
should_relativize = opts.key?(:relative) ? opts[:relative] : config[:relative_links]
|
77
|
+
anchor = opts[:anchor]
|
77
78
|
|
79
|
+
# The first call to `super()` is only to find the correct URL. The next
|
80
|
+
# call will relativize and add the anchor.
|
78
81
|
opts[:relative] = false
|
82
|
+
opts[:anchor] = nil
|
79
83
|
|
80
84
|
href = super(path_or_resource, opts)
|
81
85
|
|
@@ -87,6 +91,7 @@ class Middleman::CoreExtensions::Internationalization < ::Middleman::Extension
|
|
87
91
|
end
|
88
92
|
|
89
93
|
opts[:relative] = should_relativize
|
94
|
+
opts[:anchor] = anchor
|
90
95
|
|
91
96
|
begin
|
92
97
|
super(final_path, opts)
|
@@ -45,6 +45,10 @@ module Middleman
|
|
45
45
|
attr = el.attr.dup
|
46
46
|
link = attr.delete('href')
|
47
47
|
|
48
|
+
# options to link_to are expected to be symbols, but in Markdown
|
49
|
+
# everything is a string.
|
50
|
+
attr.transform_keys!(&:to_sym)
|
51
|
+
|
48
52
|
scope.link_to(content, link, attr)
|
49
53
|
end
|
50
54
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.3.
|
4
|
+
version: 4.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Reynolds
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-
|
13
|
+
date: 2019-08-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -1553,7 +1553,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1553
1553
|
- !ruby/object:Gem::Version
|
1554
1554
|
version: '0'
|
1555
1555
|
requirements: []
|
1556
|
-
|
1556
|
+
rubyforge_project:
|
1557
|
+
rubygems_version: 2.7.10
|
1557
1558
|
signing_key:
|
1558
1559
|
specification_version: 4
|
1559
1560
|
summary: Hand-crafted frontend development
|