github-to-canvas 0.1.14 → 0.1.15

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b94622944d8bc1fca2bf802c4fcb9705c8fb9e51072b363cfe8be85c5304680
4
- data.tar.gz: ba10efd6629d42c8bf53d729c4a739f7ee5954c978357382841079020d32386f
3
+ metadata.gz: 2fdb3495cf035026b326415c643f799389f104d417f3131504bc173756f6139b
4
+ data.tar.gz: 1e33feb5268015f1db19089686fe8c10299ec925f2b49c2c4a1f9b759fe5092f
5
5
  SHA512:
6
- metadata.gz: dc71149053f243875c46622f376a13996b16b892e09153af2d6189652f082d1fa5b4d6d2cd5adb920484f30bb91e303d3d89b50aa3ccacb2a0885570b548ea61
7
- data.tar.gz: facf3dbde83c5d033f08aadbcf399d9112364e57da18056da6c0fbd65634df6718fc3ae41c16d7e84252369dbeca57e1b8c151d13f8135ffc0b70273993e68b6
6
+ metadata.gz: 4e3db83d774f1b815faf65f09b7cb63b2e76a04c80eef1671b1bf2130540a387ed89333556fc96257e56862885a3ce83670ebeb4094abd142e83b50c5dae3a5f
7
+ data.tar.gz: abe6c2dbd1ccc1e710f5ca9e32bfba5dadb7e1651ed03656115b3db1cbfc11b378d12f224a075952c87ada6411c2f989e401504290d0c8a71748adf664eef216
@@ -1,5 +1,5 @@
1
1
  require 'redcarpet'
2
- # require 'byebug'
2
+ require 'byebug'
3
3
  class CustomRender < Redcarpet::Render::HTML
4
4
  def block_code(code, lang)
5
5
  "<pre>" \
@@ -100,13 +100,28 @@ class RepositoryConverter
100
100
 
101
101
 
102
102
  def self.escape_existing_html(markdown)
103
- # markdown = markdown.gsub(/<\/(?!iframe)/, "&lt;/")
103
+ markdown = markdown.gsub(/```(\n|.)*```/) { |code|
104
+ # all blocks
105
+ code = code.gsub("<", "&lt;")
106
+ code = code.gsub(">", "&gt;")
107
+ }
108
+ # markdown = markdown.gsub(/(`)(.+?)(`)/) { |code|
109
+ # # all backticks
110
+
111
+ # if code.match?(/<(.*?)>/)
112
+ # code = code.gsub("<", "&lt;")
113
+ # code = code.gsub(">", "&gt;")
114
+ # end
115
+
116
+ # code
117
+ # }
104
118
  # markdown = markdown.gsub(/<(?!iframe)/, "&lt;")
105
119
  # markdown = markdown.gsub(/(?<!iframe)>/, "&gt;")
106
- # byebug
120
+
107
121
  # markdown = markdown.gsub(/```(.*?)```/) {|s|
108
122
  # byebug
109
123
  # }
124
+ markdown
110
125
  end
111
126
 
112
127
  def self.remove_header_and_footer(html)
@@ -1,3 +1,3 @@
1
1
  class GithubToCanvas
2
- VERSION = "0.1.14"
2
+ VERSION = "0.1.15"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-to-canvas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - maxwellbenton