gibier 0.8.13 → 0.8.14

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: 957b52d284d1d034e614346257b222cf38fcf51ca2e23d329ee7cabba96e0668
4
- data.tar.gz: 30a5b7ccb60977450a1f55e48d2d7782f83142a605cfe4eaaf3cd532be8c0fc5
3
+ metadata.gz: 9a4d7b82509129dc9e1f98e27e777f1544baa1c0994cb5de54f6e63808178232
4
+ data.tar.gz: 9a9adec540981104883c0da092c04eb310f9c20247583c5b8d2415b45c71c112
5
5
  SHA512:
6
- metadata.gz: 9d8f17585ae58b50d692a6eab33c5bc3102eccd64af778c99ec06356a0a69cf769bf38bb7b4a91cbdbb46b52a164eac6c8bddd37fac6cf50aac99cdc10cb451f
7
- data.tar.gz: e744f18063796a31b61022449969b79701c7c57171a287e5e2efb31b90e9cebc031193fe051464dc04eb20105eaa0090fbb54efa817bae83bb67b2902e7863d7
6
+ metadata.gz: d7f9a0a2d45a0ba7db4ee2e866dce2e573b8973cd1148bf2855a6cefb64ea7e4a621140d81075b3b35b1683590f519b24ca40649d4b2d5691fe35e2d42d6ef9e
7
+ data.tar.gz: da5f0ca6b8f022ddc5826abf848c73ff72453a61172da2be413f8c524e153607883c20645548f4544a3703de88188b727369e1a373b6fceac2bbaf4d585c3b0a
@@ -8,7 +8,8 @@ class String
8
8
  end
9
9
 
10
10
  def expand_tag
11
- m = /\A(?<head>.*?)(?<body><(?<tag>\w+)( (?<attrs>{(\w+:.+?)(, \w:.+?)*}))?>(?<inner>.*?)<\/\k<tag>>)(?<tail>.*?)\z/.match(self)
11
+ str = self.gsub(/<br>\n/, '<br></br>')
12
+ m = /\A(?<head>.*?)(?<body><(?<tag>\w+)( (?<attrs>{(\w+:.+?)(, \w:.+?)*}))?>(?<inner>.*?)<\/\k<tag>>)(?<tail>.*?)\z/.match(str)
12
13
  if m
13
14
  arr = []
14
15
  arr << m[:head].escape unless m[:head].empty?
@@ -57,7 +58,6 @@ module Gibier
57
58
  :block_quote,
58
59
 
59
60
  # span-level calls
60
- :autolink,
61
61
  :underline,
62
62
  :triple_emphasis,
63
63
  :superscript, :highlight,
@@ -177,6 +177,10 @@ EOD
177
177
  "<a {href:#{link.escape}, target:\"_blank\"}>#{content}</a>"
178
178
  end
179
179
 
180
+ def autolink(url, type)
181
+ "<a {href:#{url.escape}, target:\"_brank\"}>#{url}</a>"
182
+ end
183
+
180
184
  def image(link, title, alt_text)
181
185
  href = "\#{Gibier.assets_path}/images/#{link}"
182
186
  "<p {class:\"#{alt_text}\"}><img {src:#{href.escape}}></img></p>"
@@ -33,7 +33,7 @@ module Gibier
33
33
  def self.load_slide(name)
34
34
  File.open("#{src_path(name)}/pages.rb", "w+") do |f|
35
35
  data = File.read("data/#{name}/slide.md")
36
- markdown = Redcarpet::Markdown.new(Gibier::Renderer.create(name), fenced_code_blocks: true)
36
+ markdown = Redcarpet::Markdown.new(Gibier::Renderer.create(name), autolink: true, fenced_code_blocks: true)
37
37
  f.write markdown.render(data)
38
38
  end
39
39
 
@@ -1,3 +1,3 @@
1
1
  module Gibier
2
- VERSION = "0.8.13"
2
+ VERSION = "0.8.14"
3
3
  end
@@ -46,6 +46,18 @@ render as shown on the next page
46
46
 
47
47
  default font
48
48
 
49
+ ## Link
50
+
51
+ ```
52
+ * [Link](http://youchan.org/gibier/sample/)
53
+ * http://youchan.org/gibier/sample/
54
+ ```
55
+
56
+ ## Link
57
+
58
+ * [Link](http://youchan.org/gibier/sample/)
59
+ * http://youchan.org/gibier/sample/
60
+
49
61
  ## Image
50
62
 
51
63
  ```
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gibier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.13
4
+ version: 0.8.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - youchan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-13 00:00:00.000000000 Z
11
+ date: 2018-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra