From 5efcf487985e7348ed3d39f33b7185028a6e3716 Mon Sep 17 00:00:00 2001 From: murphy Date: Sat, 21 May 2011 03:03:31 +0000 Subject: various fixes and cleanups in CodeRay's helpers --- lib/coderay/scanners/text.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/coderay/scanners/text.rb (limited to 'lib/coderay/scanners/text.rb') diff --git a/lib/coderay/scanners/text.rb b/lib/coderay/scanners/text.rb new file mode 100644 index 0000000..bde9029 --- /dev/null +++ b/lib/coderay/scanners/text.rb @@ -0,0 +1,26 @@ +module CodeRay + module Scanners + + # Scanner for plain text. + # + # Yields just one token of the kind :plain. + # + # Alias: +plaintext+, +plain+ + class Text < Scanner + + register_for :text + title 'Plain text' + + KINDS_NOT_LOC = [:plain] # :nodoc: + + protected + + def scan_tokens encoder, options + encoder.text_token string, :plain + encoder + end + + end + + end +end -- cgit v1.2.1