jekyll-spaceship 0.8.3 → 0.8.4

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: c2a6f219ec49d2767f11891946203051ed55b82567d0021c929eb1831769e246
4
- data.tar.gz: 80bdf4869aaf201752f791031b6730b0d3e86681cdb246f4855db960ec913a60
3
+ metadata.gz: 25f6fbade2f14b20f7a5144628801f0caa203ee2246eb84611e5effc2c2264b6
4
+ data.tar.gz: f6ec1d64569913303f51ce4c01c4cd1a57fc1a47da4b01f35721c0737a78d007
5
5
  SHA512:
6
- metadata.gz: b7ff25fd47603c5f3471db4d33cad716956ee41918fa5408fae35176025658122ee4cc567db6a68675d4c1e677d9f7b50a0e32ce12fb0eae1a3e8525503be8f0
7
- data.tar.gz: ca6a2e4071c8eac5f8759778bb2c0e228a3b94369c16815fb150e8041b685a11e60f18dcd7f05afae3e9fbcf8075b5bfb61046248ff440b5dbefb80cedcef02e
6
+ metadata.gz: 4b93d15db0794dc3c70960ad6e5471d5bcd3f90ddb0abb16473b471657483ec9cc9f968bfb237729f3cfe7f546a203fb3924c48a06e68429379bfbd66d343f40
7
+ data.tar.gz: ff4bb5fe973f5aaec4aa2eef63bfbd29c1ba8aabad20b9ef316414c088abb3c64387263beb3930d3d0110a7c6e996bf392ff2065a44f19ecf193fd15a9af046e
@@ -65,7 +65,7 @@ module Jekyll::Spaceship
65
65
 
66
66
  def initialize_exclusions
67
67
  if @@_exclusions.size.zero?
68
- self.class.exclude :code, :math
68
+ self.class.exclude :code, :math, :liquid_filter
69
69
  end
70
70
  @exclusions = @@_exclusions.uniq
71
71
  @@_exclusions.clear
@@ -156,15 +156,17 @@ module Jekyll::Spaceship
156
156
  @exclusions.each do |type|
157
157
  regex = nil
158
158
  if type == :code
159
- regex = /((`+)\s*(\w*)((?:.|\n)*?)\2)/
159
+ regex = /(((?<!\\)`+)\s*(\w*)((?:.|\n)*?)\2)/
160
160
  elsif type == :math
161
161
  regex = /(((?<!\\)\${1,2})[^\n]*?\1)/
162
+ elsif type == :liquid_filter
163
+ regex = /((?<!\\)\{\{[^\n]*?\}\})/
162
164
  end
163
165
  next if regex.nil?
164
166
  content.scan(regex) do |match_data|
165
167
  match = match_data[0]
166
168
  id = @exclusion_store.size
167
- content = content.sub(match, "[JEKYLL@#{object_id}@#{id}]")
169
+ content = content.sub(match, "<!JEKYLL@#{object_id}@#{id}>")
168
170
  @exclusion_store.push match
169
171
  end
170
172
  end
@@ -175,7 +177,7 @@ module Jekyll::Spaceship
175
177
  while @exclusion_store.size > 0
176
178
  match = @exclusion_store.pop
177
179
  id = @exclusion_store.size
178
- content = content.sub("[JEKYLL@#{object_id}@#{id}]", match)
180
+ content = content.sub("<!JEKYLL@#{object_id}@#{id}>", match)
179
181
  end
180
182
  @exclusion_store = []
181
183
  content
@@ -24,15 +24,16 @@ module Jekyll::Spaceship
24
24
 
25
25
  # escape plus sign
26
26
  emoji_name = emoji.name.gsub('+', '\\\+')
27
+ css_class = self.config['css']['class']
27
28
 
28
29
  content = content.gsub(
29
30
  /(?<!\=")\s*:#{emoji_name}:\s*(?!"\s)/,
30
- "<img class=\"\""\
31
+ "<img class=\"#{css_class}\""\
31
32
  " title=\":#{emoji.name}:\""\
32
33
  " alt=\":#{emoji.name}:\""\
33
34
  " raw=\"#{emoji.raw}\""\
34
35
  " src=\"#{config['src']}#{emoji.image_filename}\""\
35
- " style=\"vertical-align: middle;"\
36
+ " style=\"vertical-align: middle; display: inline;"\
36
37
  " max-width: 1em; visibility: hidden;\""\
37
38
  " onload=\"this.style.visibility='visible'\""\
38
39
  " onerror=\"this.replaceWith(this.getAttribute('raw'))\">"\
@@ -243,7 +243,11 @@ module Jekyll::Spaceship
243
243
  .gsub(/(?<!\\)\|/, '\\|')
244
244
  .gsub(/^\s+|\s+$/, '')
245
245
  content = cvter.convert(content)
246
- cell.inner_html = Nokogiri::HTML.fragment(content)
246
+ content = Nokogiri::HTML.fragment(content)
247
+ if content.children.first&.name == 'p'
248
+ content = content.children
249
+ end
250
+ cell.inner_html = content.inner_html
247
251
  end
248
252
  end
249
253
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Spaceship
5
- VERSION = "0.8.3"
5
+ VERSION = "0.8.4"
6
6
  end
7
7
  end
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.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - jeffreytse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-04 00:00:00.000000000 Z
11
+ date: 2020-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll