jekyll-spaceship 0.5.1 → 0.6.1
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 +4 -4
- data/.travis.yml +2 -0
- data/README.md +47 -2
- data/jekyll-spaceship.gemspec +1 -0
- data/lib/jekyll-spaceship.rb +2 -6
- data/lib/jekyll-spaceship/cores/config.rb +65 -0
- data/lib/jekyll-spaceship/cores/manager.rb +4 -3
- data/lib/jekyll-spaceship/cores/processor.rb +23 -0
- data/lib/jekyll-spaceship/processors/emoji-processor.rb +14 -43
- data/lib/jekyll-spaceship/processors/mathjax-processor.rb +2 -7
- data/lib/jekyll-spaceship/processors/plantuml-processor.rb +23 -10
- data/lib/jekyll-spaceship/processors/table-processor.rb +9 -6
- data/lib/jekyll-spaceship/processors/video-processor.rb +1 -0
- data/lib/jekyll-spaceship/utils/.keep +0 -0
- data/lib/jekyll-spaceship/version.rb +1 -1
- metadata +18 -3
- data/lib/jekyll-spaceship/utils/plantuml/plantuml.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca3414a157fe1966031e109e08be4805790638d24fa4f7197bf74fc231b69778
|
4
|
+
data.tar.gz: 95b7d289cd489e28c09902ff5b7f6e35229847cab376df5be9bbab3434f4e41f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27e7c3291a2994b03b8670a920ff8cb9d8727a1986debc19d1cf1a92989fc651790353cf29811d2cead664bf999fb0cb77ebb676b5af5773192b8d934e3ce90d
|
7
|
+
data.tar.gz: fde58815d50920a1c1c9b4c6694b0600e7a02102bd2d86edad24db469487942e9fdad477a70c567afbcd8e527275bc093328b7b0e75627ed0c194247155361d4
|
data/.travis.yml
CHANGED
@@ -27,6 +27,8 @@ deploy:
|
|
27
27
|
secure: AqjHemFJsIxFuudjWzYbUGBpA5wpAB9Ate6oDZMGMnpaoSD2VgfkBDklyFfEh5uuHrh+rU6U9MPv4wknXVIV7gTTY18ATgzciLa+JCVjhAaSoPGSkORT15/kKpVp4IXIoEytj5T9D+8Wc8czd/B1+lMGGu7n7d7gMvg0HsjOLzJtAOYPrRUTaTXDLeIA+rPnsI1IzbvfHzcZvuD70XkBJWN9kiu0djlI6o51XQNumWMJrFAD/NDD3h3tZ0kkI0TalAYbWVRkZ/ZeABKAod3IRAXGt4L2MM2eYqE5KaXb/GE5wISib3I/iTCjjwrNlM+wM9a+mnOkC+elaCJm1LENqP5Ocy9wbOLYmC8i1VpPDXm2bskbj32oy1wf5zeQUf6bnPB+wDmwgCirYb7z2jQlV4BzRRkDCTftfNTa8FIi03kf+i7phjHuj18j/JC3Ww1ApRq71JAuqEnUY0wBaaN3M5abrJsYOxCRnYVPcBn/w8gfkXuhv9xvDG2OgwqIjDiECPjmbeK8Apo9kgKSrfjBQ43q62Ore6SuVCS+PZOOxVnHmfphfT4xc1atyVeMLkSvnWOa/sWTwgOSXqt1TYAEEhb734AsfXeRMzxU/LN1Y4nZ0otuEv+HVHA/XeHLA1Skq9vHhtZaORhJ58Jmwv5oMwA8KC/wPrn0gGtSBPe8zxw=
|
28
28
|
gem: jekyll-spaceship
|
29
29
|
on:
|
30
|
+
rvm: 2.3
|
30
31
|
tags: true
|
31
32
|
repo: jeffreytse/jekyll-spaceship
|
33
|
+
edge: true
|
32
34
|
cleanup: false
|
data/README.md
CHANGED
@@ -64,8 +64,8 @@
|
|
64
64
|
|
65
65
|
<div align="center">
|
66
66
|
<h4>
|
67
|
-
<a href="#requirements">Requirements</a> |
|
68
67
|
<a href="#installation">Install</a> |
|
68
|
+
<a href="#configuration">Config</a> |
|
69
69
|
<a href="#usage">Usage</a> |
|
70
70
|
<a href="#credits">Credits</a> |
|
71
71
|
<a href="#license">License</a>
|
@@ -82,10 +82,18 @@
|
|
82
82
|
|
83
83
|
A Jekyll plugin to provide powerful supports for table, mathjax, plantuml, emoji, youtube, vimeo, dailymotion, etc.
|
84
84
|
|
85
|
+
<p align="center">
|
86
|
+
<img alt="Jekyll Spaceship Demo" src="https://user-images.githubusercontent.com/9413601/82250463-15451780-997e-11ea-8809-f411586d9508.gif" alt="Donate (Ko-fi)" />
|
87
|
+
</p>
|
88
|
+
|
89
|
+
**💡 Tip:** I hope you enjoy using this plugin. If you like this project, **a little star** for it is your way make a clear statement: **My work is valued**. I would appreciate your support! _Thank you!_
|
90
|
+
|
91
|
+
|
85
92
|
## Table of Contents
|
86
93
|
|
87
94
|
- [Requirements](#requirements)
|
88
95
|
- [Installation](#installation)
|
96
|
+
- [Configuration](#configuration)
|
89
97
|
- [Usage](#usage)
|
90
98
|
- [1. Table Usage](#1-table-usage)
|
91
99
|
- [1.1 Rowspan and Colspan](#rowspan-and-colspan)
|
@@ -121,13 +129,42 @@ Add jekyll-spaceship plugin in your site's `Gemfile`, and run `bundle install`.
|
|
121
129
|
gem 'jekyll-spaceship'
|
122
130
|
```
|
123
131
|
|
124
|
-
Add jekyll-spaceship to the `
|
132
|
+
Add jekyll-spaceship to the `plugins:` section in your site's `_config.yml`.
|
125
133
|
|
126
134
|
```yml
|
127
135
|
plugins:
|
128
136
|
- jekyll-spaceship
|
129
137
|
```
|
130
138
|
|
139
|
+
**💡 Tip:** Note that GitHub Pages runs in `safe` mode and only allows [a set of whitelisted plugins](https://pages.github.com/versions/). To use the gem in GitHub Pages, you need to build locally or use CI (e.g. [travis](https://travis-ci.org/), [github workflow](https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow)) and deploy to your `gh-pages` branch. [Click here for more information.](https://jekyllrb.com/docs/continuous-integration/github-actions/) (e.g. [https://github.com/jeffreytse/jekyll-jeffreytse-blog](https://github.com/jeffreytse/jekyll-jeffreytse-blog))
|
140
|
+
|
141
|
+
## Configuration
|
142
|
+
|
143
|
+
This plugin runs with the following configuration options by default. Alternative settings for these options can be explicitly specified in the configuration file `_config.yml`.
|
144
|
+
|
145
|
+
```yml
|
146
|
+
# Where things are
|
147
|
+
jekyll-spaceship:
|
148
|
+
processors:
|
149
|
+
- table-processor
|
150
|
+
- mathjax-processor
|
151
|
+
- plantuml-processor
|
152
|
+
- polyfill-processor
|
153
|
+
- video-processor
|
154
|
+
- emoji-processor
|
155
|
+
mathjax-processor:
|
156
|
+
src: //cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
|
157
|
+
config:
|
158
|
+
tex2jax:
|
159
|
+
inlineMath:
|
160
|
+
- ['$','$']
|
161
|
+
- ['\(','\)']
|
162
|
+
plantuml-processor:
|
163
|
+
src: http://www.plantuml.com/plantuml/png/
|
164
|
+
emoji-processor:
|
165
|
+
src: https://github.githubassets.com/images/icons/emoji/
|
166
|
+
```
|
167
|
+
|
131
168
|
## Usage
|
132
169
|
|
133
170
|
### 1. Table Usage
|
@@ -492,6 +529,10 @@ $ 2^{\frac{n-1}{3}} $
|
|
492
529
|
$ \int\_a^b f(x)\,dx. $
|
493
530
|
```
|
494
531
|
|
532
|
+
Code above would be parsed as:
|
533
|
+
|
534
|
+
<image alt="MathJax Expression" height="180" src="https://user-images.githubusercontent.com/9413601/82814245-5a5ed180-9ec9-11ea-9d5b-fba303c627ac.png"></image>
|
535
|
+
|
495
536
|
### 3. PlantUML Usage
|
496
537
|
|
497
538
|
[PlantUML](http://plantuml.sourceforge.net/) is a component that allows to quickly write:
|
@@ -520,6 +561,10 @@ Bob -> Alice : hello
|
|
520
561
|
@enduml
|
521
562
|
```
|
522
563
|
|
564
|
+
Code above would be parsed as:
|
565
|
+
|
566
|
+

|
567
|
+
|
523
568
|
### 4. Video Usage
|
524
569
|
|
525
570
|
How often did you find yourself googling "**How to embed a video in markdown?**"
|
data/jekyll-spaceship.gemspec
CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_dependency "jekyll", ">= 3.6", "< 5.0"
|
22
22
|
spec.add_dependency "nokogiri", "~> 1.6"
|
23
|
+
spec.add_dependency "gemoji", "~> 3.0"
|
23
24
|
spec.add_dependency "rainbow", "~> 3.0"
|
24
25
|
|
25
26
|
spec.add_development_dependency "bundler"
|
data/lib/jekyll-spaceship.rb
CHANGED
@@ -1,16 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'jekyll-spaceship/cores/logger'
|
4
|
+
require 'jekyll-spaceship/cores/config'
|
4
5
|
require 'jekyll-spaceship/cores/manager'
|
5
6
|
require 'jekyll-spaceship/cores/processor'
|
6
7
|
require 'jekyll-spaceship/cores/register'
|
7
8
|
|
8
9
|
module Jekyll::Spaceship
|
9
10
|
Logger.display_info
|
10
|
-
|
11
|
-
Register.use 'mathjax-processor'
|
12
|
-
Register.use 'plantuml-processor'
|
13
|
-
Register.use 'polyfill-processor'
|
14
|
-
Register.use 'video-processor'
|
15
|
-
Register.use 'emoji-processor'
|
11
|
+
Config.load
|
16
12
|
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
module Jekyll::Spaceship
|
6
|
+
class Config
|
7
|
+
CONFIG_NAME = 'jekyll-spaceship'
|
8
|
+
DEFAULT_CONFIG = {
|
9
|
+
'processors' => [
|
10
|
+
'table-processor',
|
11
|
+
'mathjax-processor',
|
12
|
+
'plantuml-processor',
|
13
|
+
'polyfill-processor',
|
14
|
+
'video-processor',
|
15
|
+
'emoji-processor'
|
16
|
+
],
|
17
|
+
'mathjax-processor' => {
|
18
|
+
'src' => '//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML',
|
19
|
+
'config' => {
|
20
|
+
'tex2jax' => { 'inlineMath' => [['$','$'], ['\\(','\\)']] }
|
21
|
+
}
|
22
|
+
},
|
23
|
+
'plantuml-processor' => {
|
24
|
+
'src' => 'http://www.plantuml.com/plantuml/png/'
|
25
|
+
},
|
26
|
+
'emoji-processor' => {
|
27
|
+
'src' => 'https://github.githubassets.com/images/icons/emoji/'
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
@@store = {}
|
32
|
+
|
33
|
+
def self.deep_merge(first, second)
|
34
|
+
merger = proc do |_, f, s|
|
35
|
+
if Hash === f && Hash === s
|
36
|
+
f.merge(s, &merger)
|
37
|
+
elsif Array === f && Array === s
|
38
|
+
s || f
|
39
|
+
else
|
40
|
+
[:undefined, nil, :nil].include?(s) ? f : s
|
41
|
+
end
|
42
|
+
end
|
43
|
+
first.merge(second.to_h, &merger)
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.store(section)
|
47
|
+
@@store[section]
|
48
|
+
end
|
49
|
+
|
50
|
+
def self.load(filename = '_config.yml')
|
51
|
+
config = deep_merge(
|
52
|
+
{ CONFIG_NAME => DEFAULT_CONFIG },
|
53
|
+
YAML.load_file(File.expand_path(filename))
|
54
|
+
)[CONFIG_NAME]
|
55
|
+
@@store = config
|
56
|
+
self.use_processors(config)
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.use_processors(config)
|
60
|
+
config['processors'].each do |processor|
|
61
|
+
Register.use processor
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -15,7 +15,7 @@ module Jekyll::Spaceship
|
|
15
15
|
events = _register.last.uniq
|
16
16
|
events = events.select do |event|
|
17
17
|
next true if event.match(/^post/)
|
18
|
-
next
|
18
|
+
next events.index(event.to_s.gsub(/^pre/, 'post').to_sym).nil?
|
19
19
|
end
|
20
20
|
events.each do |event|
|
21
21
|
self.hook container, event
|
@@ -69,7 +69,8 @@ module Jekyll::Spaceship
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def self.ext(page)
|
72
|
-
page.
|
72
|
+
ext = page.path.match(/\.\S+$/)
|
73
|
+
ext.to_s.rstrip
|
73
74
|
end
|
74
75
|
|
75
76
|
def self.output_ext(page)
|
@@ -112,7 +113,7 @@ module Jekyll::Spaceship
|
|
112
113
|
end
|
113
114
|
node.replace Nokogiri::HTML.fragment content
|
114
115
|
end
|
115
|
-
page.output = doc.to_html
|
116
|
+
page.output = Processor.escape_html doc.to_html
|
116
117
|
end
|
117
118
|
end
|
118
119
|
end
|
@@ -18,6 +18,7 @@ module Jekyll::Spaceship
|
|
18
18
|
|
19
19
|
attr_reader :page
|
20
20
|
attr_reader :logger
|
21
|
+
attr_reader :config
|
21
22
|
attr_reader :priority
|
22
23
|
attr_reader :registers
|
23
24
|
attr_reader :exclusions
|
@@ -27,11 +28,20 @@ module Jekyll::Spaceship
|
|
27
28
|
self.class.name.split('::').last
|
28
29
|
end
|
29
30
|
|
31
|
+
def filename
|
32
|
+
self.name
|
33
|
+
.gsub(/([A-Z]+)([A-Z][a-z])/,'\1-\2')
|
34
|
+
.gsub(/([a-z\d])([A-Z])/,'\1-\2')
|
35
|
+
.tr("_", "-")
|
36
|
+
.downcase
|
37
|
+
end
|
38
|
+
|
30
39
|
def initialize()
|
31
40
|
self.initialize_priority
|
32
41
|
self.initialize_register
|
33
42
|
self.initialize_exclusions
|
34
43
|
@logger = Logger.new(self.name)
|
44
|
+
@config = Config.store(self.filename)
|
35
45
|
end
|
36
46
|
|
37
47
|
def initialize_priority
|
@@ -112,6 +122,9 @@ module Jekyll::Spaceship
|
|
112
122
|
end
|
113
123
|
if self.respond_to? method
|
114
124
|
@page.output = self.send method, @page.output
|
125
|
+
if Type.html? output_ext
|
126
|
+
@page.output = self.class.escape_html(@page.output)
|
127
|
+
end
|
115
128
|
end
|
116
129
|
end
|
117
130
|
end
|
@@ -158,5 +171,15 @@ module Jekyll::Spaceship
|
|
158
171
|
@exclusion_store = []
|
159
172
|
content
|
160
173
|
end
|
174
|
+
|
175
|
+
def self.escape_html(content)
|
176
|
+
# escape link
|
177
|
+
content.scan(/((https?:)?\/\/\S+\?[a-zA-Z0-9%\-_=\.&;]+)/) do |result|
|
178
|
+
result = result[0]
|
179
|
+
link = result.gsub('&', '&')
|
180
|
+
content = content.gsub(result, link)
|
181
|
+
end
|
182
|
+
content
|
183
|
+
end
|
161
184
|
end
|
162
185
|
end
|
@@ -1,65 +1,36 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'net/http'
|
4
|
-
require 'uri'
|
5
4
|
require 'json'
|
5
|
+
require 'gemoji'
|
6
6
|
|
7
7
|
module Jekyll::Spaceship
|
8
8
|
class EmojiProcessor < Processor
|
9
|
-
EMOJI_MARKUP_HOST = 'https://api.github.com/emojis'
|
10
|
-
EMOJI_MARKUP_DATA = {}
|
11
|
-
|
12
|
-
def initialize
|
13
|
-
super()
|
14
|
-
self.initialize_emoji_data
|
15
|
-
end
|
16
|
-
|
17
|
-
def initialize_emoji_data
|
18
|
-
EMOJI_MARKUP_DATA.update get_emoji_markup_data
|
19
|
-
end
|
20
|
-
|
21
9
|
def on_handle_html(content)
|
22
|
-
return content if EMOJI_MARKUP_DATA.size.zero?
|
23
10
|
# handle emoji markup
|
24
|
-
content.scan(/:([\w+-]+):/) do |
|
25
|
-
|
26
|
-
|
27
|
-
next if emoji_image.nil?
|
11
|
+
content.scan(/:([\w\d+-]+):/) do |match|
|
12
|
+
emoji = Emoji.find_by_alias match[0]
|
13
|
+
next if emoji.nil?
|
28
14
|
self.handled = true
|
29
15
|
|
30
|
-
#
|
31
|
-
|
32
|
-
if unicode[1]
|
33
|
-
unicode = "0x#{unicode[1]}".to_i(16)
|
34
|
-
alt = [unicode].pack('U*')
|
35
|
-
end
|
36
|
-
alt = emoji_markup if alt.nil?
|
16
|
+
# escape plus sign
|
17
|
+
emoji_name = emoji.name.gsub('+', '\\\+')
|
37
18
|
|
38
19
|
content = content.gsub(
|
39
|
-
"
|
40
|
-
"<
|
41
|
-
title=\"
|
42
|
-
alt=\"
|
43
|
-
|
20
|
+
/(?<!\=")\s*:#{emoji_name}:\s*(?!"\s)/,
|
21
|
+
"<img class=\"emoji\" \
|
22
|
+
title=\":#{emoji.name}:\" \
|
23
|
+
alt=\":#{emoji.name}:\" \
|
24
|
+
raw=\"#{emoji.raw}\" \
|
25
|
+
src=\"#{config['src']}#{emoji.image_filename}\" \
|
44
26
|
style=\"vertical-align: middle; \
|
45
27
|
max-width: 1em; visibility: hidden;\" \
|
46
28
|
onload=\"this.style.visibility='visible'\" \
|
47
|
-
onerror=\"this.replaceWith(this.
|
48
|
-
</
|
29
|
+
onerror=\"this.replaceWith(this.getAttribute('raw'))\"> \
|
30
|
+
</img>"
|
49
31
|
)
|
50
32
|
end
|
51
33
|
content
|
52
34
|
end
|
53
|
-
|
54
|
-
def get_emoji_markup_data
|
55
|
-
data = {}
|
56
|
-
begin
|
57
|
-
source = Net::HTTP.get URI(EMOJI_MARKUP_HOST)
|
58
|
-
data = JSON.parse(source)
|
59
|
-
rescue StandardError => msg
|
60
|
-
logger.log msg
|
61
|
-
end
|
62
|
-
data
|
63
|
-
end
|
64
35
|
end
|
65
36
|
end
|
@@ -18,13 +18,8 @@ module Jekyll::Spaceship
|
|
18
18
|
|
19
19
|
self.handled = true
|
20
20
|
|
21
|
-
|
22
|
-
src
|
23
|
-
config = "MathJax.Hub.Config({ \
|
24
|
-
tex2jax: { inlineMath: [['$','$'], ['\\\\(','\\\\)']] } \
|
25
|
-
});"
|
26
|
-
|
27
|
-
head.add_child("<script src=\"#{src}\">#{config}</script>")
|
21
|
+
cfg = "MathJax.Hub.Config(#{config['config'].to_json});"
|
22
|
+
head.add_child("<script src=\"#{config['src']}\">#{cfg}</script>")
|
28
23
|
|
29
24
|
doc.to_html
|
30
25
|
end
|
@@ -1,7 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "net/http"
|
4
|
+
require "base64"
|
5
|
+
|
3
6
|
module Jekyll::Spaceship
|
4
|
-
class
|
7
|
+
class PlantumlProcessor < Processor
|
5
8
|
exclude :none
|
6
9
|
|
7
10
|
def on_handle_markdown(content)
|
@@ -35,18 +38,28 @@ module Jekyll::Spaceship
|
|
35
38
|
|
36
39
|
def handle_plantuml(code)
|
37
40
|
# wrap plantuml code
|
38
|
-
|
39
|
-
|
40
|
-
dir = File.dirname(__FILE__)
|
41
|
-
jar = dir + "/../utils/plantuml/plantuml.jar"
|
42
|
-
echo = "echo -e \"#{uml.gsub('"', '\"')}\""
|
43
|
-
plantuml = "java -jar \"#{jar}\" -pipe 2>/dev/null"
|
41
|
+
code = "@startuml#{code}@enduml".encode('UTF-8')
|
44
42
|
|
45
|
-
#
|
46
|
-
|
43
|
+
# encode to hex string
|
44
|
+
code = '~h' + code.unpack("H*").first
|
45
|
+
data = self.get_plantuml_img_data(code)
|
47
46
|
|
48
47
|
# return img tag
|
49
|
-
"<img src=\"
|
48
|
+
"<img class=\"plantuml\" src=\"#{data}\">"
|
49
|
+
end
|
50
|
+
|
51
|
+
def get_plantuml_img_data(code)
|
52
|
+
data = ''
|
53
|
+
url = "#{config['src']}#{code}"
|
54
|
+
begin
|
55
|
+
data = Net::HTTP.get URI(url)
|
56
|
+
data = Base64.encode64(data)
|
57
|
+
data = "data:image/png;base64, #{data}"
|
58
|
+
rescue StandardError => msg
|
59
|
+
data = url
|
60
|
+
logger.log msg
|
61
|
+
end
|
62
|
+
data
|
50
63
|
end
|
51
64
|
end
|
52
65
|
end
|
@@ -157,7 +157,7 @@ module Jekyll::Spaceship
|
|
157
157
|
if scope.table.multi_row_cells != cells and scope.table.multi_row_start
|
158
158
|
for i in 0...scope.table.multi_row_cells.count do
|
159
159
|
multi_row_cell = scope.table.multi_row_cells[i]
|
160
|
-
multi_row_cell.
|
160
|
+
multi_row_cell.inner_html += "<br>#{cells[i].inner_html}"
|
161
161
|
end
|
162
162
|
row.remove
|
163
163
|
end
|
@@ -182,7 +182,7 @@ module Jekyll::Spaceship
|
|
182
182
|
span_cell = scope.table.span_row_cells[scope.row.col_index]
|
183
183
|
if span_cell and cell.content.match(/^\s*\^{2}/)
|
184
184
|
cell.content = cell.content.gsub(/^\s*\^{2}/, '')
|
185
|
-
span_cell.
|
185
|
+
span_cell.inner_html += "<br>#{cell.inner_html}"
|
186
186
|
rowspan = span_cell.get_attribute('rowspan') || 1
|
187
187
|
rowspan = rowspan.to_i + 1
|
188
188
|
span_cell.set_attribute('rowspan', "#{rowspan}")
|
@@ -207,11 +207,12 @@ module Jekyll::Spaceship
|
|
207
207
|
align += 2
|
208
208
|
end
|
209
209
|
|
210
|
+
# handle text align
|
211
|
+
return if align == 0
|
212
|
+
|
210
213
|
# handle escape colon
|
211
214
|
cell.content = cell.content.gsub(/\\:/, ':')
|
212
215
|
|
213
|
-
# handle text align
|
214
|
-
return if align == 0
|
215
216
|
style = cell.get_attribute('style')
|
216
217
|
if align == 1
|
217
218
|
align = 'text-align: left'
|
@@ -234,8 +235,10 @@ module Jekyll::Spaceship
|
|
234
235
|
cell = data.cell
|
235
236
|
cvter = self.converter('markdown')
|
236
237
|
return if cvter.nil?
|
237
|
-
content = cell.
|
238
|
-
|
238
|
+
content = cell.inner_html
|
239
|
+
.gsub(/(?<!\\)\|/, '\\|')
|
240
|
+
.gsub(/^\s+|\s+$/, '')
|
241
|
+
content = cvter.convert(content)
|
239
242
|
cell.inner_html = Nokogiri::HTML.fragment(content)
|
240
243
|
end
|
241
244
|
end
|
File without changes
|
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.
|
4
|
+
version: 0.6.1
|
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-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -44,6 +44,20 @@ dependencies:
|
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '1.6'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: gemoji
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '3.0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '3.0'
|
47
61
|
- !ruby/object:Gem::Dependency
|
48
62
|
name: rainbow
|
49
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -117,6 +131,7 @@ files:
|
|
117
131
|
- Rakefile
|
118
132
|
- jekyll-spaceship.gemspec
|
119
133
|
- lib/jekyll-spaceship.rb
|
134
|
+
- lib/jekyll-spaceship/cores/config.rb
|
120
135
|
- lib/jekyll-spaceship/cores/logger.rb
|
121
136
|
- lib/jekyll-spaceship/cores/manager.rb
|
122
137
|
- lib/jekyll-spaceship/cores/processor.rb
|
@@ -128,7 +143,7 @@ files:
|
|
128
143
|
- lib/jekyll-spaceship/processors/polyfill-processor.rb
|
129
144
|
- lib/jekyll-spaceship/processors/table-processor.rb
|
130
145
|
- lib/jekyll-spaceship/processors/video-processor.rb
|
131
|
-
- lib/jekyll-spaceship/utils
|
146
|
+
- lib/jekyll-spaceship/utils/.keep
|
132
147
|
- lib/jekyll-spaceship/version.rb
|
133
148
|
- logos/jekyll-spaceship-logo.png
|
134
149
|
- script/cibuild
|
Binary file
|