slack_mrkdwn 1.0.0 → 1.1.0

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/slack_mrkdwn.rb +1 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d57a2dbe717ff391670a6f4c35a5c421437a0867c59813268ddaaa83be29d3da
4
- data.tar.gz: 494d619b848b736f3956a3c62e2cc41ab73fd7048274939bdf1b16f5256dd49c
3
+ metadata.gz: 6fb434ec4e2a6b8b07bd993d085d084384d789f0d4d70d9565cf645bf7105fe5
4
+ data.tar.gz: 1a0d9b3fd9cf9d77e9ece675ad831f539bef09f2c9295959a5a39c1159d19287
5
5
  SHA512:
6
- metadata.gz: 20ae648f95d1db327693ec757c53597e189dfa8de5891b937a073210952d4c60035233694dc7cdfdf49c5fd5f3ea584add6ef8d39eae946ffd09eacdbfbb8a20
7
- data.tar.gz: 26415a1578e7aaeafb680cade122b4d684a7749c677f721ad8138e3f996cf136e0c69ba2c1b1d4790b16a9bd9c64a21f0db93ce800ea5eb0bcc43c5a43e1517f
6
+ metadata.gz: 3343f8f4ae7d41bfcb657dde186a61a3483ca8133b94592305b061c94cc5eb800cf59264a62fd7706f502dcc93a1e26eac8ec53a272dbe9a4c8d29f71e404c38
7
+ data.tar.gz: 31a7cc9df0fae701736c6acbfeef1da3beaf20162a2a3d89d860e6c538204a3f31ff50cf9b5c1ef677b562561dc7a39b97d0110a80c0033510990529da9c0f62
data/lib/slack_mrkdwn.rb CHANGED
@@ -9,6 +9,7 @@ module SlackMrkdwn
9
9
  .gsub(/`{3}\w*(.*?)`{3}/m, '```\1```') # Codeblock
10
10
  .gsub(/^ +/, '\t') # Leading spaces
11
11
  .gsub(/^((?:\\t)*?)[\*\+-] (.+)/, '\1- \2') # Unordered lists
12
+ .gsub(/\!\[.*?\]\((.+?)(?: .*?)?\)/, '\1') # Image
12
13
  .gsub(/\[(.+?)\]\((.+?)(?: .*?)?\)/, '<\2|\1>') # Classic link
13
14
  .gsub(/\[(.+?)\]\[(.+?)\]/) { |m| markdown.match?(/\[#{$2}\]: (.+)/i) ? ("|#{$1}>".prepend(/\[#{$2}\]: (.+)/i.match(markdown) { |n| "<#{$1}" })) : "[#{$1}][#{$2}]" } # Reference-style links
14
15
  .gsub(/\[(.+?)\]/) { |m| markdown.match?(/\[#{$1}\]: (.+)/i) ? ("|#{$1}>".prepend(/\[#{$1}\]: (.+)/i.match(markdown) { |n| "<#{$1}" })) : "[#{$1}]" } # Reference-style - Text only links
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack_mrkdwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Cousineau