jekyll-highlight 1.0.4 → 1.0.5
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/jekyll-highlight.gemspec +1 -1
- data/lib/jekyll-highlight/highlight_tag.rb +4 -2
- data/lib/jekyll-highlight/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1c937d8c8bfd2ca89319de6020dab4862c3a4e3
|
4
|
+
data.tar.gz: 55fe13f8f4ddb163cbf364df12825a21fb8a6854
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 663bc41edd1f6b4c10c6f4920c226e3a9f992c65e2edb8fb473b9a198eac5b996b7ba0c391dd7dbbf440ab13741518a51fae04a209fb497af7f16e112d04aee2
|
7
|
+
data.tar.gz: 5690285ae2a2f383875d66087dfbea5a78e981f7b6475fcc6f0e2865d4d076a217df42aa12d15a87e0a3e35569617f506037f47e2327f92ef0386a9268099ae1
|
data/jekyll-highlight.gemspec
CHANGED
@@ -27,5 +27,5 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_development_dependency "rake", "~> 10.0"
|
28
28
|
spec.add_development_dependency "rspec", "~> 3.0"
|
29
29
|
spec.add_development_dependency "rubocop", "~> 0.47.1"
|
30
|
-
spec.add_development_dependency "byebug" if RUBY_VERSION >= "2.0"
|
30
|
+
spec.add_development_dependency "byebug", "~> 0" if RUBY_VERSION >= "2.0"
|
31
31
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
module Jekyll
|
2
2
|
module Tags
|
3
|
+
# rubocop:disable Metrics/ClassLength
|
3
4
|
class HighlightBlock < Liquid::Block
|
4
5
|
include Liquid::StandardFilters
|
5
6
|
|
@@ -8,7 +9,7 @@ module Jekyll
|
|
8
9
|
# forms: name, name=value, or name="<quoted list>"
|
9
10
|
#
|
10
11
|
# <quoted list> is a space-separated list of numbers
|
11
|
-
PARAM_SYNTAX = /^([a-zA-Z0-9.+#_-]+)((\s+\w+(=(\w+|"([0-9]+\s)*[0-9]+"))?)*)$/
|
12
|
+
PARAM_SYNTAX = /^([a-zA-Z0-9.+#_-]+)((\s+\w+(=(\w+|"([0-9]+\s)*[0-9]+"|"([^"]+)"))?)*)$/
|
12
13
|
|
13
14
|
# rubocop:disable Style/GuardClause
|
14
15
|
def initialize(tag_name, markup, tokens)
|
@@ -126,11 +127,12 @@ eos
|
|
126
127
|
end
|
127
128
|
|
128
129
|
def add_code_tag(code)
|
130
|
+
figcaption = "<figcaption>File: #{@highlight_options[:filename].join(' ')}</figcaption>" if @highlight_options.key?(:filename)
|
129
131
|
code_attributes = [
|
130
132
|
"class=\"language-#{@lang.to_s.tr('+', '-')}\"",
|
131
133
|
"data-lang=\"#{@lang}\""
|
132
134
|
].join(" ")
|
133
|
-
"<figure class=\"highlight\"
|
135
|
+
"<figure class=\"highlight\">#{figcaption}<pre><code #{code_attributes}>"\
|
134
136
|
"#{code.chomp}</code></pre></figure>"
|
135
137
|
end
|
136
138
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-highlight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Torgny Bjers
|
@@ -70,14 +70,14 @@ dependencies:
|
|
70
70
|
name: byebug
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
description: Syntax highlighter for code and text.
|