Skip to content

Commit

Permalink
Fixes styling of <figure> code header
Browse files Browse the repository at this point in the history
  • Loading branch information
fhemberger committed Sep 18, 2011
1 parent 31adeee commit 44e4a99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions plugins/code_block.rb
Expand Up @@ -24,7 +24,7 @@
# #
# Output: # Output:
# #
# <figure role=code> # <figure class='code'>
# <figcaption><span>Got pain? painrelief.sh</span> <a href="http://site.com/painrelief.sh">Download it!</a> # <figcaption><span>Got pain? painrelief.sh</span> <a href="http://site.com/painrelief.sh">Download it!</a>
# <div class="highlight"><pre><code class="sh"> # <div class="highlight"><pre><code class="sh">
# -- nicely escaped highlighted code -- # -- nicely escaped highlighted code --
Expand All @@ -37,7 +37,7 @@
# <sarcasm>Ooooh, sarcasm... How original!</sarcasm> # <sarcasm>Ooooh, sarcasm... How original!</sarcasm>
# {% endcodeblock %} # {% endcodeblock %}
# #
# <figure role=code> # <figure class='code'>
# <pre><code>&lt;sarcasm> Ooooh, sarcasm... How original!&lt;/sarcasm></code></pre> # <pre><code>&lt;sarcasm> Ooooh, sarcasm... How original!&lt;/sarcasm></code></pre>
# </figure> # </figure>
# #
Expand Down Expand Up @@ -80,7 +80,7 @@ def initialize(tag_name, markup, tokens)
def render(context) def render(context)
output = super output = super
code = super.join code = super.join
source = "<figure role=code>" source = "<figure class='code'>"
source += @caption if @caption source += @caption if @caption
if @filetype if @filetype
source += " #{highlight(code, @filetype)}</figure>" source += " #{highlight(code, @filetype)}</figure>"
Expand Down
2 changes: 1 addition & 1 deletion plugins/include_code.rb
Expand Up @@ -61,7 +61,7 @@ def render(context)
@filetype = file.extname.sub('.','') if @filetype.nil? @filetype = file.extname.sub('.','') if @filetype.nil?
title = @title ? "#{@title} (#{file.basename})" : file.basename title = @title ? "#{@title} (#{file.basename})" : file.basename
url = "/#{code_dir}/#{@file}" url = "/#{code_dir}/#{@file}"
source = "<figure role=code><figcaption><span>#{title}</span> <a href='#{url}'>download</a></figcaption>\n" source = "<figure class='code'><figcaption><span>#{title}</span> <a href='#{url}'>download</a></figcaption>\n"
source += " #{highlight(code, @filetype)}</figure>" source += " #{highlight(code, @filetype)}</figure>"
safe_wrap(source) safe_wrap(source)
end end
Expand Down

0 comments on commit 44e4a99

Please sign in to comment.