Refactor
This commit is contained in:
@@ -486,7 +486,7 @@ $(document).ready(function() {
|
||||
// Set text direction auto
|
||||
$('.markdown-body p, .markdown-body span, .markdown-body pre, .markdown-body table').attr('dir','auto');
|
||||
|
||||
// Copy anchors for each editable header and give it the new anchor the 'edit' class, to display a link to edit the section
|
||||
// Copy anchors for each editable header and give the new anchor the 'edit' class, to display an "edit section" link
|
||||
$('a.anchor').each(function (index, anchor) {
|
||||
header = $(anchor).closest(':header');
|
||||
if (header.hasClass('editable')){
|
||||
|
||||
@@ -52,11 +52,11 @@ module Precious
|
||||
Octicons::Octicon.new(symbol, parameters).to_svg
|
||||
end
|
||||
|
||||
# Well-formed SVG with XMLNS and height/width removed, for use in CSS
|
||||
def rocticon_css(symbol, parameters = {})
|
||||
html = rocticon(symbol, parameters.merge({xmlns: 'http://www.w3.org/2000/svg'}))
|
||||
html.gsub!(/\s*(width|height)=["']\d+["']\s*/, ' ') # remove height and width attributes so it can be set via CSS
|
||||
html.gsub!(/\s+/, ' ')
|
||||
html.force_encoding('UTF-8')
|
||||
octicon = Octicons::Octicon.new(symbol, parameters.merge({xmlns: 'http://www.w3.org/2000/svg'}))
|
||||
[:width, :height].each {|option| octicon.options.delete(option)}
|
||||
octicon.to_svg
|
||||
end
|
||||
|
||||
def octicon
|
||||
|
||||
Reference in New Issue
Block a user