summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners/plaintext.rb
blob: e1764032484baade1cd33b6ad351cdec51d95dcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module CodeRay
module Scanners
  
  # Scanner for plain text.
  # 
  # Yields just one token of the kind :plain.
  # 
  # Alias: +plain+
  class Plaintext < Scanner

    register_for :plaintext, :plain
    title 'Plain text'
    
    include Streamable
    
    KINDS_NOT_LOC = [:plain]  # :nodoc:
    
  protected
    
    def scan_tokens encoder, options
      encoder.text_token string, :plain
      encoder
    end

  end

end
end