10000 Speed up HTML encoder for 1.2 by korny · Pull Request #153 · rubychan/coderay · GitHub
[go: up one dir, main page]

Skip to content

Speed up HTML encoder for 1.2 #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
even less API changes
  • Loading branch information
korny committed Oct 3, 2013
commit 94ced6235d43c21e035c39c9da9c94d987447eef
3 changes: 1 addition & 2 deletions lib/coderay/encoders/html/css.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ def style
@style ||= CodeRay::Styles[@style_name]
end

def css
def stylesheet
@css ||= [
style::CSS_MAIN_STYLES,
style::TOKEN_COLORS.gsub(/^(?!$)/, '.CodeRay ')
].join("\n")
end
alias stylesheet css

def get_style_for_css_classes css_classes
cl = styles[css_classes.first]
Expand Down
2 changes: 1 addition & 1 deletion lib/coderay/encoders/html/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def extended o # :nodoc:
end

def make_stylesheet css, in_tag = false # :nodoc:
sheet = css.css
sheet = css.stylesheet
sheet = <<-'CSS' if in_tag
<style type="text/css">
#{sheet}
Expand Down
0