booklab-sml 0.2.5 → 0.2.6

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: cf3d4e757c389e8021c9df756edcc906b9d8d38c5f155ef274bd7e995cb3cab4
4
- data.tar.gz: 4c2fcc7a3156a8f49bc2a7d09b6287b6360ea74df08c691258595fc3a69f0bb7
3
+ metadata.gz: 30e79485c7e85c457be39d1512c57fa025bcda9c879a23b18b0cfb4922f051fe
4
+ data.tar.gz: 7ec715ebae02d3cbf5d2d0066b01092e43d49925bba72c0b55fdf93a2ded9019
5
5
  SHA512:
6
- metadata.gz: 10d089ba2e86f1e6a32b8c68cd83de8a1a4bbc6d3963401810619306688ff8a77c9d317cd6c819f6c4b89831f9700662e27de13ced51b0ff4b47a2b44aba943d
7
- data.tar.gz: 71c31b3a9c53fadd12d7b50c3a3b8a3c7e90116142c98d9135aa0a183231ec0ed77c680197227f6822a7263c5485bb4859bad4932fce7efc8228a3a6b6ea6be4
6
+ metadata.gz: dedcca0d0c032236827c67cdf1bba7d522a951bfcf4e6b0fe300c09f73abc912892d912a5aeb74cd63a786eeaa9cc63f4876b63767e57eda3b2a50e7f73950f3
7
+ data.tar.gz: d63575938702e60ddc07e8f2d27e8d37ac303d57c5f14d7c43953e878f2588eeb7cea8b8eb1fdee3a45edd4909ef48482cf0f78b8613f7b4ca812f71a6efb781
@@ -17,7 +17,7 @@ module BookLab::SML::Rules
17
17
  attrs = attributes(node)
18
18
 
19
19
  language = attrs[:language]
20
- code = attrs[:code]
20
+ code = attrs[:code] || ""
21
21
 
22
22
  block_code(code, language)
23
23
  end
@@ -12,6 +12,7 @@ module BookLab::SML::Rules
12
12
 
13
13
  def self.to_html(node, opts = {})
14
14
  attrs = attributes(node)
15
+ attrs[:name] ||= ""
15
16
 
16
17
  return attrs[:name] if attrs[:src].blank?
17
18
 
@@ -10,7 +10,7 @@ module BookLab::SML::Rules
10
10
 
11
11
  def self.to_html(node, opts = {})
12
12
  renderer = opts[:renderer]
13
- title = renderer.children_to_html(node)
13
+ title = renderer.children_to_html(node) || ""
14
14
  heading_tag = tag_name(node)
15
15
 
16
16
  title_length = title.length
@@ -8,6 +8,7 @@ module BookLab::SML::Rules
8
8
 
9
9
  def self.to_html(node, opts = {})
10
10
  attrs = attributes(node)
11
+ attrs[:name] ||= ""
11
12
 
12
13
  return attrs[:name] if attrs[:src].blank?
13
14
 
@@ -10,7 +10,10 @@ module BookLab::SML::Rules
10
10
  renderer = opts[:renderer]
11
11
  attrs = attributes(node)
12
12
 
13
- svg_code = URI::encode(attrs[:code])
13
+ code = (attrs[:code] || "").strip
14
+ return "" if code.blank?
15
+
16
+ svg_code = URI::encode(code)
14
17
  src = "#{renderer.config.mathjax_service_host}/svg?tex=#{svg_code}"
15
18
 
16
19
  %(<img class="tex-image" src="#{src}">)
@@ -10,7 +10,10 @@ module BookLab::SML::Rules
10
10
  attrs = attributes(node)
11
11
  renderer = opts[:renderer]
12
12
 
13
- svg_code = URI::encode((attrs[:code] || "").strip)
13
+ code = (attrs[:code] || "").strip
14
+ return "" if code.blank?
15
+
16
+ svg_code = URI::encode(code)
14
17
  %(<img src="#{renderer.config.plantuml_service_host}/svg/#{svg_code}" class="plantuml-image" />)
15
18
  end
16
19
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module BookLab
4
4
  module SML
5
- VERSION = "0.2.5"
5
+ VERSION = "0.2.6"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: booklab-sml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-11 00:00:00.000000000 Z
11
+ date: 2019-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -110,7 +110,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  requirements: []
113
- rubygems_version: 3.0.1
113
+ rubyforge_project:
114
+ rubygems_version: 2.7.8
114
115
  signing_key:
115
116
  specification_version: 4
116
117
  summary: SML is a rich text format for describe of the BookLab rich contents.