summaryrefslogtreecommitdiff
path: root/lib/coderay/encoder.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/coderay/encoder.rb')
-rw-r--r--lib/coderay/encoder.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/coderay/encoder.rb b/lib/coderay/encoder.rb
index 85a2456..cc331d1 100644
--- a/lib/coderay/encoder.rb
+++ b/lib/coderay/encoder.rb
@@ -153,7 +153,17 @@ module CodeRay
#
# See the HTML Encoder for an example of option caching.
def setup options
- @out = ''
+ @out = get_output(options)
+ end
+
+ def get_output options
+ options[:out] || ''
+ end
+
+ # Append data.to_s to the output. Returns the argument.
+ def output data
+ @out << data.to_s
+ data
end
# Called with merged options after encoding starts.