github-to-canvas 0.1.10 → 0.1.15
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:
|
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
|
@@ -98,11 +98,11 @@ class CanvasInterface
|
|
98
98
|
lesson_info = lesson_info[0] if lesson_info.kind_of?(Array)
|
99
99
|
url = url.sub(/[^\/]+$/, lesson_info["page_id"].to_s)
|
100
100
|
end
|
101
|
-
|
102
101
|
response = RestClient.put(url, payload, headers)
|
103
|
-
rescue
|
102
|
+
rescue Exception => e
|
104
103
|
puts "Something went wrong while pushing lesson #{options[:id]} to course #{options[:course_id]}"
|
105
104
|
puts "Make sure you are working on lessons that are not locked"
|
105
|
+
raise e
|
106
106
|
abort
|
107
107
|
end
|
108
108
|
JSON.parse(response.body)
|
@@ -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)
|