From c499d778d87d233a22d0a3199594e36546841b62 Mon Sep 17 00:00:00 2001 From: murphy Date: Sat, 11 Jun 2011 17:31:28 +0000 Subject: fix XML encoder (make token methods public) --- lib/coderay/encoders/xml.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/coderay/encoders') diff --git a/lib/coderay/encoders/xml.rb b/lib/coderay/encoders/xml.rb index d3e8832..f2e7c02 100644 --- a/lib/coderay/encoders/xml.rb +++ b/lib/coderay/encoders/xml.rb @@ -1,38 +1,38 @@ module CodeRay module Encoders - + # = XML Encoder # # Uses REXML. Very slow. class XML < Encoder - + register_for :xml - + FILE_EXTENSION = 'xml' - + require 'rexml/document' - + DEFAULT_OPTIONS = { :tab_width => 8, :pretty => -1, :transitive => false, } - + protected - def setup options @doc = REXML::Document.new @doc << REXML::XMLDecl.new @tab_width = options[:tab_width] @root = @node = @doc.add_element('coderay-tokens') end - + def finish options @out = '' @doc.write @out, options[:pretty], options[:transitive], true @out end + public def text_token text, kind if kind == :space token = @node -- cgit v1.2.1