Skip to content

Commit

Permalink
Improved PR #149 regex for matching sh_lang files.
Browse files Browse the repository at this point in the history
  • Loading branch information
goncalossilva committed Mar 5, 2012
1 parent 6e71652 commit 7269bdc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/showoff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,7 @@ def index(static=false)
@pause_msg = ShowOffUtils.pause_msg

# Identify which languages to bundle for highlighting
@languages = []
@languages += @slides.scan(/<pre class="(sh_.*?\w)"/).uniq.map{ |w| "sh_lang/#{w[0]}.min.js"}
@languages = @slides.scan(/<pre class=".*(?!sh_sourceCode)(sh_[\w-]+).*"/).uniq.map{ |w| "sh_lang/#{w[0]}.min.js"}

@asset_path = "./"
end
Expand Down Expand Up @@ -464,8 +463,7 @@ def pdf(static=true)
@no_js = false

# Identify which languages to bundle for highlighting
@languages = []
@languages += @slides.scan(/<pre class="(sh_.*?\w)"/).uniq.map{ |w| "/sh_lang/#{w[0]}.min.js"}
@languages = @slides.scan(/<pre class=".*(?!sh_sourceCode)(sh_[\w-]+).*"/).uniq.map{ |w| "/sh_lang/#{w[0]}.min.js"}

html = erb :onepage
# TODO make a random filename
Expand Down

0 comments on commit 7269bdc

Please sign in to comment.