Merge remote-tracking branch 'origin/master' into xdite-merge
Conflicts: lib/gollum/markup.rb
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
</td>
|
||||
<td class="author">
|
||||
<a href="javascript:void(0)">
|
||||
<img src="http://www.gravatar.com/avatar/{{gravatar}}?s=16"
|
||||
<img src="https://secure.gravatar.com/avatar/{{gravatar}}?s=16"
|
||||
alt="avatar: {{author}}" class="mini-gravatar">
|
||||
<span class="username">{{author}}</span>
|
||||
</a>
|
||||
|
||||
@@ -53,17 +53,13 @@ module Gollum
|
||||
doc = Nokogiri::HTML::DocumentFragment.parse(data)
|
||||
doc = sanitize.clean_node!(doc) if sanitize
|
||||
yield doc if block_given?
|
||||
data = doc_to_html(doc)
|
||||
data = doc.to_html
|
||||
end
|
||||
data = process_tex(data)
|
||||
data.gsub!(/<p><\/p>/, '')
|
||||
data
|
||||
end
|
||||
|
||||
def doc_to_html(doc)
|
||||
doc.to_xhtml(:save_with => Nokogiri::XML::Node::SaveOptions::AS_XHTML)
|
||||
end
|
||||
|
||||
#########################################################################
|
||||
#
|
||||
# TeX
|
||||
|
||||
@@ -43,7 +43,7 @@ module Gollum
|
||||
|
||||
# Default whitelisted protocols for URLs.
|
||||
PROTOCOLS = {
|
||||
'a' => {'href' => ['http', 'https', 'mailto', :relative]},
|
||||
'a' => {'href' => ['http', 'https', 'mailto', 'ftp', 'irc', :relative]},
|
||||
'img' => {'src' => ['http', 'https', :relative]}
|
||||
}.freeze
|
||||
|
||||
|
||||
+7
-9
@@ -54,32 +54,30 @@ module Gollum
|
||||
# Gets the markup class used by all instances of this Wiki.
|
||||
# Default: Gollum::Markup
|
||||
def markup_classes
|
||||
@markup_classes ||
|
||||
@markup_classes ||=
|
||||
if superclass.respond_to?(:markup_classes)
|
||||
superclass.markup_classes
|
||||
else
|
||||
classes = Hash.new(::Gollum::Markup)
|
||||
|
||||
# Add custom markup classes for different languages
|
||||
classes[:markdown] = ::Gollum::MarkupGFM
|
||||
classes
|
||||
Hash.new(::Gollum::Markup)
|
||||
end
|
||||
end
|
||||
|
||||
# Gets the default markup class used by all instances of this Wiki.
|
||||
# Kept for backwards compatibility until Gollum v2.x
|
||||
def markup_class
|
||||
markup_classes[:default]
|
||||
def markup_class(language=:default)
|
||||
markup_classes[language]
|
||||
end
|
||||
|
||||
# Sets the default markup class used by all instances of this Wiki.
|
||||
# Kept for backwards compatibility until Gollum v2.x
|
||||
def markup_class=(default)
|
||||
new_classes = Hash.new default
|
||||
@markup_classes = Hash.new(default).update(markup_classes)
|
||||
default
|
||||
end
|
||||
|
||||
alias_method :default_markup_class, :markup_class
|
||||
alias_method :default_markup_class=, :markup_class=
|
||||
|
||||
# Gets the default sanitization options for current pages used by
|
||||
# instances of this Wiki.
|
||||
def sanitization
|
||||
|
||||
Reference in New Issue
Block a user