Changeset 154113


Ignore:
Timestamp:
Oct 22, 2016, 1:54:03 AM (13 months ago)
Author:
raimue@…
Message:

guide: escape string for regex replace

Special characters such as '&' could trigger strange behavior as they were
interpreted by the regex engine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc-new/toc-for-chunked.tcl

    r120885 r154113  
    1717    set file [open $path r+]
    1818    set data [read $file]
    19     regsub {<body([^>]+)>} $data $replacement data
     19    regsub {<body([^>]+)>} $data [regsub -all {\W} $replacement {\\&}] data
    2020    regsub {</body>} $data {</div></body>} data
    2121    seek $file 0
Note: See TracChangeset for help on using the changeset viewer.