jekyll-spaceship 0.9.2 → 0.9.3
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: 993252decbad6e7d20ed20245f3ba7c7858eb5845402b06605a8b05d6268225f
|
4
|
+
data.tar.gz: 45012fc8ca11671a98d36b1e1c6dfbfef67cc1c12f01f265ed507760e96f40fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 139508a04521719d9160e2a0cff09a75600dffc5cae80c9dd75ec047495be87a1a7b786b859d5e335df9226d35617aa9e6470a4905fb497799f2c0c9981d6da2
|
7
|
+
data.tar.gz: 00b615b28c36a335749d5b3dcd7a60e55b8639b2d86ae8e027243985c939e75333fd4c882ed84999f3de07b43ff07c632db62f88f3641dc4634c744f91a2b279
|
data/README.md
CHANGED
@@ -966,7 +966,7 @@ Automatically adds a `target="_blank" rel="noopener noreferrer"` attribute to al
|
|
966
966
|
jekyll-spaceship:
|
967
967
|
element-processor:
|
968
968
|
css:
|
969
|
-
- a: #
|
969
|
+
- a: # Replace all `a` tags
|
970
970
|
props:
|
971
971
|
class: ['(^.*$)', '\0 ext-link'] # Add `ext-link` to class by regex pattern
|
972
972
|
target: _blank # Replace `target` value to `_blank`
|
@@ -982,7 +982,7 @@ Automatically adds `loading="lazy"` to `img` and `iframe` tags to natively load
|
|
982
982
|
jekyll-spaceship:
|
983
983
|
element-processor:
|
984
984
|
css:
|
985
|
-
- a: #
|
985
|
+
- a: # Replace all `a` tags
|
986
986
|
props: #
|
987
987
|
loading: lazy # Replace `loading` value to `lazy`
|
988
988
|
```
|
@@ -997,7 +997,7 @@ See the following examples to prevent lazy loading.
|
|
997
997
|
jekyll-spaceship:
|
998
998
|
element-processor:
|
999
999
|
css:
|
1000
|
-
- a: #
|
1000
|
+
- a: # Replace all `a` tags
|
1001
1001
|
props: #
|
1002
1002
|
loading: eager # Replace `loading` value to `eager`
|
1003
1003
|
```
|
@@ -116,7 +116,7 @@ module Jekyll::Spaceship
|
|
116
116
|
if self.respond_to? method
|
117
117
|
@page.content = self.pre_exclude @page.content
|
118
118
|
@page.content = self.send method, @page.content
|
119
|
-
@page.content = self.
|
119
|
+
@page.content = self.post_exclude @page.content
|
120
120
|
end
|
121
121
|
else
|
122
122
|
if Type.html? output_ext
|
@@ -151,8 +151,8 @@ module Jekyll::Spaceship
|
|
151
151
|
logger.log file
|
152
152
|
end
|
153
153
|
|
154
|
-
def
|
155
|
-
|
154
|
+
def exclusion_regexs()
|
155
|
+
regexs = []
|
156
156
|
@exclusions.each do |type|
|
157
157
|
regex = nil
|
158
158
|
if type == :code
|
@@ -162,7 +162,14 @@ module Jekyll::Spaceship
|
|
162
162
|
elsif type == :liquid_filter
|
163
163
|
regex = /((?<!\\)((\{\{[^\n]*?\}\})|(\{%[^\n]*?%\})))/
|
164
164
|
end
|
165
|
-
|
165
|
+
regexs.push regex unless regex.nil?
|
166
|
+
end
|
167
|
+
regexs
|
168
|
+
end
|
169
|
+
|
170
|
+
def pre_exclude(content, regexs = self.exclusion_regexs())
|
171
|
+
@exclusion_store = []
|
172
|
+
regexs.each do |regex|
|
166
173
|
content.scan(regex) do |match_data|
|
167
174
|
match = match_data[0]
|
168
175
|
id = @exclusion_store.size
|
@@ -173,7 +180,7 @@ module Jekyll::Spaceship
|
|
173
180
|
content
|
174
181
|
end
|
175
182
|
|
176
|
-
def
|
183
|
+
def post_exclude(content)
|
177
184
|
while @exclusion_store.size > 0
|
178
185
|
match = @exclusion_store.pop
|
179
186
|
id = @exclusion_store.size
|
@@ -305,10 +305,12 @@ module Jekyll::Spaceship
|
|
305
305
|
cvter = self.converter('markdown')
|
306
306
|
return if cvter.nil?
|
307
307
|
content = cell.inner_html
|
308
|
+
content = self.pre_exclude(content, [/(\<code.*\>.*\<\/code\>)/])
|
308
309
|
.gsub(/(?<!\\)\|/, '\\|')
|
309
310
|
.gsub(/^\s+|\s+$/, '')
|
310
311
|
.gsub(/</, '<')
|
311
312
|
.gsub(/>/, '>')
|
313
|
+
content = self.post_exclude(content)
|
312
314
|
content = cvter.convert(content)
|
313
315
|
content = Nokogiri::HTML.fragment(content)
|
314
316
|
if content.children.first&.name == 'p'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-spaceship
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jeffreytse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|