jekyll-spaceship 0.10.0 → 0.10.1

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: 0e78e90266b5520e8f2779dea8af5f83b3bb4107d5666eac6dae98d2f754c88e
4
- data.tar.gz: 2a485a89f512d3c1da45b52ba679f76575de7c91be34d687f2104984f286fb5f
3
+ metadata.gz: 65e9ff74fc3f41dbe577381aee9352d4086282b7f626b7a2c6b0a07dc31b3528
4
+ data.tar.gz: 623506291192de23202d2e808d0d33b01a7d2834a57d84052732a14ea63b9f11
5
5
  SHA512:
6
- metadata.gz: 6268083908d3ec0ff4420b13efd4b35acde48329d2339d7e793f29f0c2a8311f5d7aef36ec5fa95a5e2d94fe3cc04db8fb540f00a0e10f26335dcedb8da236de
7
- data.tar.gz: 0b5d5950a8a446429cf4a00c3ebba32cde6068f4d3856e00f2868933cfa8031ef3af0b1bee0c5d40e28ea1abd19530a87b3addfd184a543ad27a3684ee10cb01
6
+ metadata.gz: e98e212490178eec39e3c93773d6320b368dabcdab90657f97a1214e4eff35b47fe32bb4102a9831d4c93a77211c01fe17069dd484f2517f6a1661bb133aa754
7
+ data.tar.gz: 02a5dca457388cae099933aae86e24915c4b73ea32199a7d89e87e738cc43730e064663940446b21f395f58f74d8ab02b2c38cb87d81a20b92799f0e70a659c3
data/README.md CHANGED
@@ -112,6 +112,7 @@ Spaceship is a minimalistic, powerful and extremely customizable [Jekyll](https:
112
112
  - [5.2 Vimeo Usage](#vimeo-usage)
113
113
  - [5.3 DailyMotion Usage](#dailymotion-usage)
114
114
  - [5.4 Spotify Usage](#spotify-usage)
115
+ - [5.4 Spotify Podcast Usage](#spotify-podcast-usage)
115
116
  - [5.5 SoundCloud Usage](#soundcloud-usage)
116
117
  - [5.6 General Video Usage](#general-video-usage)
117
118
  - [5.7 General Audio Usage](#general-audio-usage)
@@ -791,6 +792,15 @@ the link as below:
791
792
 
792
793
  <image width="600" src="https://user-images.githubusercontent.com/9413601/89762618-5d11b000-db23-11ea-81db-35cc3682b234.png">
793
794
 
795
+ #### Spotify Podcast Usage
796
+
797
+ ```markdown
798
+ ![](https://open.spotify.com/episode/31AxcwYdjsFtStds5JVWbT)
799
+ ```
800
+
801
+ <image width="600" src="https://user-images.githubusercontent.com/9413601/133599796-1d213033-8184-4059-9ec2-5415e50c94dc.png">
802
+
803
+
794
804
  #### SoundCloud Usage
795
805
 
796
806
  ```markdown
@@ -45,6 +45,7 @@ module Jekyll::Spaceship
45
45
  escaped_expr = expr
46
46
  .gsub(/(?<!^)\\(?!\S$)/, '\\\\\\\\')
47
47
  .gsub(/(?<!\\)\$\$/, '\\\$\\\$')
48
+ .gsub(/\\\\(?=\s)/, '\\\\\\\\\\')
48
49
  .gsub(/\\ /, '\\\\\\ ')
49
50
  content = content.gsub(expr, escaped_expr)
50
51
  end
@@ -92,7 +93,7 @@ module Jekyll::Spaceship
92
93
  r&.each do |i|
93
94
  btag = Regexp.escape(i[0])
94
95
  etag = Regexp.escape(i[1])
95
- patterns <<= /((?<!\\\\)#{btag}(.*?)(?<!\\\\)#{etag})/
96
+ patterns <<= /((?<!\\\\)#{btag}([\s\S]*?)(?<!\\\\)#{etag})/
96
97
  end
97
98
  end
98
99
  end
@@ -122,6 +123,19 @@ module Jekyll::Spaceship
122
123
 
123
124
  # scan mathjax expressions
124
125
  doc.css('body *').each do |node|
126
+ # filter invalid nodes
127
+ next if node.children.size == 0
128
+ invalid = false
129
+ node.children.each do |child|
130
+ unless [
131
+ 'text', 'br', 'span',
132
+ 'img', 'svg', 'a'
133
+ ].include? child.name
134
+ break invalid = true
135
+ end
136
+ end
137
+ next if invalid
138
+
125
139
  patterns['include'].each do |pattern|
126
140
  # check normal mathjax expression
127
141
  node.content.scan(pattern) do |result|
@@ -30,6 +30,7 @@ module Jekyll::Spaceship
30
30
  handle_vimeo(element)
31
31
  handle_dailymotion(element)
32
32
  handle_spotify(element)
33
+ handle_spotify_podcast(element)
33
34
  handle_soundcloud(element)
34
35
  end
35
36
  doc.to_html
@@ -109,6 +110,19 @@ module Jekyll::Spaceship
109
110
  })
110
111
  end
111
112
 
113
+ # Examples:
114
+ # ![spotify podcast](//open.spotify.com/episode/31AxcwYdjsFtStds5JVWbT)
115
+ # ![spotify podcast](//open.spotify.com/episode/44gfWHnwbmSY7Euw6Nb39k?width=400)
116
+ def handle_spotify_podcast(element)
117
+ handle_media(element, {
118
+ media_type: 'iframe',
119
+ host: '(https?:)?\\/\\/open\\.spotify\\.com\\/episode\\/',
120
+ id: '(?<=episode\\/)([a-zA-Z0-9\\_\\-]+)',
121
+ base_url: "https://open.spotify.com/embed/episode/",
122
+ height: 152
123
+ })
124
+ end
125
+
112
126
  # Examples:
113
127
  # ![soundcloud](//soundcloud.com/aviciiofficial/preview-avicii-vs-lenny)
114
128
  def handle_soundcloud(element)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Spaceship
5
- VERSION = "0.10.0"
5
+ VERSION = "0.10.1"
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.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - jeffreytse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-28 00:00:00.000000000 Z
11
+ date: 2021-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll