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 +4 -4
- data/lib/github-to-canvas/repository_converter.rb +18 -3
- data/lib/github-to-canvas/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fdb3495cf035026b326415c643f799389f104d417f3131504bc173756f6139b
|
4
|
+
data.tar.gz: 1e33feb5268015f1db19089686fe8c10299ec925f2b49c2c4a1f9b759fe5092f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e3db83d774f1b815faf65f09b7cb63b2e76a04c80eef1671b1bf2130540a387ed89333556fc96257e56862885a3ce83670ebeb4094abd142e83b50c5dae3a5f
|
7
|
+
data.tar.gz: abe6c2dbd1ccc1e710f5ca9e32bfba5dadb7e1651ed03656115b3db1cbfc11b378d12f224a075952c87ada6411c2f989e401504290d0c8a71748adf664eef216
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'redcarpet'
|
2
|
-
|
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
|
-
|
103
|
+
markdown = markdown.gsub(/```(\n|.)*```/) { |code|
|
104
|
+
# all blocks
|
105
|
+
code = code.gsub("<", "<")
|
106
|
+
code = code.gsub(">", ">")
|
107
|
+
}
|
108
|
+
# markdown = markdown.gsub(/(`)(.+?)(`)/) { |code|
|
109
|
+
# # all backticks
|
110
|
+
|
111
|
+
# if code.match?(/<(.*?)>/)
|
112
|
+
# code = code.gsub("<", "<")
|
113
|
+
# code = code.gsub(">", ">")
|
114
|
+
# end
|
115
|
+
|
116
|
+
# code
|
117
|
+
# }
|
104
118
|
# markdown = markdown.gsub(/<(?!iframe)/, "<")
|
105
119
|
# markdown = markdown.gsub(/(?<!iframe)>/, ">")
|
106
|
-
|
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)
|