mumukit-content-type 1.6.1 → 1.7.0

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: a986de56bee7e6e7fe4c06d13437655228b50f62b9ed00cd06895123e8025799
4
- data.tar.gz: 6ce9c93efe7241d487a85c5c1e02511a8cbc9ef53b136d6684a6cea4c569a36c
3
+ metadata.gz: c924bfdc4a426f1bed9a17004c0f4f92f381ec3053e9318afaf1c858c73b33dd
4
+ data.tar.gz: 930363133ebe5aa8e68ed70af69907a0a6edff3b01b8b12fc7c7d247e09a213f
5
5
  SHA512:
6
- metadata.gz: 7a6a0c9f4e106d1a00d66d6edd42e5357fe2583c5c42fe60595c53c9c5aa2137cc2cd6b70ed39ec21cb12058888f708f636ce814c002fcaaa9320a1db06151b1
7
- data.tar.gz: 305b854842f53975e27250f90b38eb5ae980f47f2625fee36475d7b96bed2cde86d349c2f2be89ffd0636bd3666a6995d95fda232261768d9f65088dfb824e16
6
+ metadata.gz: d9794422d5750fffe7cc195c0f6b389c85b6d7615dc27cd13fcedb84fb2fe61233617e400f7851309f893f943fdfddf4ff85c1b02b81d249e4c3a4f852035d08
7
+ data.tar.gz: da760912b1bddf65c18a457403de337801cccaac64c8af4d813af7190f9853411da1e1fb5770d857c97bdc5e1a1de3801aa3fcca98f8f2d590443610b67a4de2
@@ -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
- Mumukit::ContentType::Sanitizer.sanitize(htmlize content)&.html_safe
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,5 +1,5 @@
1
1
  module Mumukit
2
2
  module ContentType
3
- VERSION = '1.6.1'
3
+ VERSION = '1.7.0'
4
4
  end
5
5
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-content-type
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli