jekyll-spaceship 0.8.7 → 0.9.0

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: c04f1aada8ea0a1dde37b51418f843e1d163e1dd7230cf602a0f7caf5d787b19
4
- data.tar.gz: 263b035717beeedaad26f42c896a2265b3be4e9bf977b2883e23d8b678f280db
3
+ metadata.gz: c6ae47db0fb8b3515463a5703cdbfa2c596262066b0af602e3d7f82360872c78
4
+ data.tar.gz: 9f4c96c07fe26d5b1e9a44338375a29470d528e2375902d9e7198cfe377d0b26
5
5
  SHA512:
6
- metadata.gz: 566854587a4dea0b991d755467dd402cc39a86235636c9e95c1fbd042ae6ee7bc28bd26ffd99b0d12a8e56ffcff469193bab5008d319e8408949382dec162bdb
7
- data.tar.gz: c79139b158834943705be273a533beef706d028fcbff9f339f08aba027ec85a872c73a522679ab2b69d09c82f6c7bd8f8f551f33bfd369040b510b3db36859c5
6
+ metadata.gz: 7a24363b63096f27c60c92aa0ad37561cf230ae6e61c0e49b7c556e9a584c1ffddc388cf3ab3cb424382351d55a30439628f6a909e93aae4cfce51363f8ffd0f
7
+ data.tar.gz: 297d038c14a9bdb8b856b414eaefba93232ff82518a3c01eaf97ac98f2dd1792d6d875a140e5f30497dbcb759f4e59a6ea6632c64c186f0acacfb249152b2c3e
data/README.md CHANGED
@@ -166,12 +166,16 @@ jekyll-spaceship:
166
166
  - emoji-processor
167
167
  - element-processor
168
168
  mathjax-processor:
169
- src: //cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
169
+ src:
170
+ - https://polyfill.io/v3/polyfill.min.js?features=es6
171
+ - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
170
172
  config:
171
- tex2jax:
173
+ tex:
172
174
  inlineMath:
173
175
  - ['$','$']
174
176
  - ['\(','\)']
177
+ svg:
178
+ fontCache: 'global'
175
179
  plantuml-processor:
176
180
  mode: default # mode value 'pre-fetch' for fetching image at building stage
177
181
  css:
@@ -160,7 +160,7 @@ module Jekyll::Spaceship
160
160
  elsif type == :math
161
161
  regex = /(((?<!\\)\${1,2})[^\n]*?\1)/
162
162
  elsif type == :liquid_filter
163
- regex = /((?<!\\)\{\{[^\n]*?\}\})/
163
+ regex = /((?<!\\)((\{\{[^\n]*?\}\})|(\{%[^\n]*?%\})))/
164
164
  end
165
165
  next if regex.nil?
166
166
  content.scan(regex) do |match_data|
@@ -6,9 +6,13 @@ module Jekyll::Spaceship
6
6
  class MathjaxProcessor < Processor
7
7
  def self.config
8
8
  {
9
- 'src' => '//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML',
9
+ 'src' => [
10
+ 'https://polyfill.io/v3/polyfill.min.js?features=es6',
11
+ 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js',
12
+ ],
10
13
  'config' => {
11
- 'tex2jax' => { 'inlineMath' => [['$','$'], ['\\(','\\)']] }
14
+ 'tex' => { 'inlineMath' => [['$','$'], ['\\(','\\)']] },
15
+ 'svg': { 'fontCache': 'global' }
12
16
  }
13
17
  }
14
18
  end
@@ -27,8 +31,15 @@ module Jekyll::Spaceship
27
31
 
28
32
  self.handled = true
29
33
 
30
- cfg = "MathJax.Hub.Config(#{config['config'].to_json});"
31
- head.add_child("<script src=\"#{config['src']}\">#{cfg}</script>")
34
+ # add mathjax config
35
+ cfg = config['config'].to_json
36
+ head.add_child("<script>MathJax=#{cfg}</script>")
37
+
38
+ # add mathjax dependencies
39
+ config['src'] = [config['src']] if config['src'].is_a? String
40
+ config['src'].each do |src|
41
+ head.add_child("<script src=\"#{src}\"></script>")
42
+ end
32
43
 
33
44
  doc.to_html
34
45
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Spaceship
5
- VERSION = "0.8.7"
5
+ VERSION = "0.9.0"
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.7
4
+ version: 0.9.0
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-30 00:00:00.000000000 Z
11
+ date: 2020-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll