mumukit-content-type 1.6.1 → 1.7.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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c924bfdc4a426f1bed9a17004c0f4f92f381ec3053e9318afaf1c858c73b33dd
|
4
|
+
data.tar.gz: 930363133ebe5aa8e68ed70af69907a0a6edff3b01b8b12fc7c7d247e09a213f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9794422d5750fffe7cc195c0f6b389c85b6d7615dc27cd13fcedb84fb2fe61233617e400f7851309f893f943fdfddf4ff85c1b02b81d249e4c3a4f852035d08
|
7
|
+
data.tar.gz: da760912b1bddf65c18a457403de337801cccaac64c8af4d813af7190f9853411da1e1fb5770d857c97bdc5e1a1de3801aa3fcca98f8f2d590443610b67a4de2
|
data/lib/mumukit/content_type.rb
CHANGED
@@ -8,8 +8,10 @@ module Mumukit
|
|
8
8
|
"#{title e.message}\n#{code e.backtrace.join("\n")}"
|
9
9
|
end
|
10
10
|
|
11
|
-
def to_html(content)
|
12
|
-
|
11
|
+
def to_html(content, options={})
|
12
|
+
content_html = htmlize content
|
13
|
+
content_html = Mumukit::ContentType::Sanitizer.sanitize(content_html) unless options[:skip_sanitization]
|
14
|
+
content_html&.html_safe
|
13
15
|
end
|
14
16
|
|
15
17
|
def to_s
|
@@ -1,13 +1,13 @@
|
|
1
1
|
class Module
|
2
|
-
def markdown_on(*selectors)
|
3
|
-
selectors.each { |selector| _define_markdown_on(selector) }
|
2
|
+
def markdown_on(*selectors, **options)
|
3
|
+
selectors.each { |selector| _define_markdown_on(selector, options) }
|
4
4
|
end
|
5
5
|
|
6
6
|
private
|
7
7
|
|
8
|
-
def _define_markdown_on(selector)
|
8
|
+
def _define_markdown_on(selector, options)
|
9
9
|
define_method("#{selector}_html".to_sym) do |*args|
|
10
|
-
Mumukit::ContentType::Markdown.to_html self.send(selector, *args)
|
10
|
+
Mumukit::ContentType::Markdown.to_html self.send(selector, *args), options
|
11
11
|
end
|
12
12
|
end
|
13
|
-
end
|
13
|
+
end
|