Changeset 2085


Ignore:
Timestamp:
2001-02-28T17:57:03+13:00 (23 years ago)
Author:
jrm21
Message:

When importing, we need to escape any escape codes otherwise mg(?)
actually converts them. eg "\n" -> "
n"

Location:
trunk/gsdl/perllib/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/SRCPlug.pm

    r1787 r2085  
    112112    # try _escape_text($text) from doc.pm....
    113113
     114    # don't want mg to turn escape chars into actual values
     115    $$textref =~ s/\\/\\\\/g;
    114116
    115117    # use filename (minus any prefix) as the title.
  • trunk/gsdl/perllib/plugins/TEXTPlug.pm

    r1730 r2085  
    6969    $doc_obj->add_utf8_metadata ($cursection, "Title", $title);
    7070    }
    71    
     71
     72    # we need to escape the escape character, or else mg will convert into
     73    # eg literal newlines, instead of leaving the text as '\n'
     74    $$textref =~ s/\\/\\\\/g;
     75
    7276    # insert preformat tags and add text to document object
    7377    $doc_obj->add_utf8_text($cursection, "<pre>\n$$textref\n</pre>");
Note: See TracChangeset for help on using the changeset viewer.