Changeset 241

Show
Ignore:
Timestamp:
02/21/2008 16:30:40 (9 months ago)
Author:
jgarber
Message:

Add different escaping for pre and notextile blocks.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/superredcloth/ext/superredcloth_scan/superredcloth_scan.rl

    r239 r241  
    2222 
    2323  # blocks 
    24   notextile_start = "<notextile>" ; 
    25   notextile_end = "</notextile>" ; 
     24  notextile_tag_start = "<notextile>" ; 
     25  notextile_tag_end = "</notextile>" ; 
    2626  notextile_line = " " (( default+ ) -- CRLF) CRLF ; 
    27   pre_start = "<pre" [^>]* ">" (space* "<code>")? ; 
    28   pre_end = ("</code>" space*)? "</pre>" ; 
     27  notextile_block_start = ( "notextile" >A %{ STORE(type) } A C :> "." ( "." %extend | "" ) " "+ ) ; 
     28  pre_tag_start = "<pre" [^>]* ">" (space* "<code>")? ; 
     29  pre_tag_end = ("</code>" space*)? "</pre>" ; 
     30  pre_block_start = ( "pre" >A %{ STORE(type) } A C :> "." ( "." %extend | "" ) " "+ ) ; 
    2931  bc_start = ( "bc" >A %{ STORE(type) } A C :> "." ( "." %extend | "" ) " "+ ) ; 
    3032  bq_start = ( "bq" >A %{ STORE(type) } A C :> "." ( "." %extend | "" ) " "+ ) ; 
    31   btype = ( "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "pre" | "notextile" | "div" ) ; 
     33  btype = ( "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" ) ; 
    3234  block_start = ( btype >A %{ STORE(type) } A C :> "." ( "." %extend | "" ) " "+ ) ; 
    3335  next_block_start = ( btype A C :> "." ) ; 
     
    6264  table = ( tdef? trows >{INLINE(table, table_open);} ) >{ reg = NULL; } ; 
    6365 
    64   pre := |* 
    65     pre_end         { CAT(block); DONE(block); fgoto main; }; 
     66  pre_tag := |* 
     67    pre_tag_end         { CAT(block); DONE(block); fgoto main; }; 
    6668    default => esc_pre; 
    6769  *|; 
    68  
    69   notextile := |* 
    70     notextile_end   { DONE(block); fgoto main; }; 
     70   
     71  pre_block := |* 
     72    EOF                { ADD_BLOCKCODE(); fgoto main; }; 
     73    extended_block_end { ADD_BLOCKCODE(); fgoto main; }; 
     74    double_return      { if (NIL_P(extend)) { ADD_BLOCKCODE(); fgoto main; } else { ADD_EXTENDED_BLOCKCODE(); } }; 
     75    default => esc_pre; 
     76  *|; 
     77 
     78  notextile_tag := |* 
     79    notextile_tag_end   { DONE(block); fgoto main; }; 
     80    default => cat; 
     81  *|; 
     82   
     83  notextile_block := |* 
     84    EOF                { DONE(block); fgoto main; }; 
     85    extended_block_end { DONE(block); fgoto main; }; 
     86    double_return      { if (NIL_P(extend)) { DONE(block); fgoto main; } else { DONE(block); } }; 
    7187    default => cat; 
    7288  *|; 
     
    111127  main := |* 
    112128    notextile_line  { CAT(block); DONE(block); }; 
    113     notextile_start { ASET(type, notextile); fgoto notextile; }; 
    114     pre_start       { ASET(type, notextile); CAT(block); fgoto pre; }; 
     129    notextile_tag_start { ASET(type, notextile); fgoto notextile_tag; }; 
     130    notextile_block_start { fgoto notextile_block; }; 
     131    pre_tag_start       { ASET(type, notextile); CAT(block); fgoto pre_tag; }; 
     132    pre_block_start { fgoto pre_block; }; 
    115133    standalone_html { CAT(block); DONE(block); }; 
    116134    html_start      { ASET(type, notextile); CAT(block); fgoto html; };