Module: W2Tags::Block::PlainText

Defined in:
lib/w2tags/block/plain_text.rb

Instance Method Summary collapse

Instance Method Details

#plain_text_skipObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/w2tags/block/plain_text.rb', line 19

def plain_text_skip
  @rgx = nil
  @plt_opt = ''
  if(/(^[\t ]*)(-!+[ ]?)([^\n]*)\n/ =~ @row;@rgx = $~)
    @row = ''
    @plt = @spc.size
    @plt_opt = @rgx[2]
    @doc_plt = []
    if @rgx[3].strip != "" 
      if @plt_opt[1,2]=='!!'
        @doc_plt << " #{@rgx[3].strip}\n" 
      else
        @doc_plt << "#{@spc} #{@rgx[3].strip}\n" 
      end
    end
  elsif @plt != 99 
    if @spc.size<= @plt && @ron!=0
      @doc_out   = @doc_out + @doc_plt
      @plt = 99
    else
      plain_text_parser
    end
  end
  @plt!=99
end

#plain_text_skip_initializeObject

when command is “-!”, it means that inside these indentation will not be parsed. Example: %head

%script
 -!
  $(function(){
    alert('Hello World');
  });


13
14
15
16
17
# File 'lib/w2tags/block/plain_text.rb', line 13

def plain_text_skip_initialize()
  @plt_opt= '' #plaintext option
  @doc_plt= [] #plaintext buffer
  @plt    = 99 #plaintext indentation
end