Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7850
    robben
    Member

    (function() {
    var word = document.selection.Text;
    var tag=prompt( “start_tag”, “p” );
    //var end_tag=prompt( “end_tag”, “p” );
    if (!tag) return;
    var start_tag=”<"+tag+">“;
    var end_tag=”“;
    if (word == ”) {
    document.selection.SelectLine();
    var str = document.selection.Text;
    if (str.replace(/s/g, ”) == ”) {
    str = str.replace(/[rn]*/g, ”);
    document.selection.Text = str;
    return;
    }
    else {
    str = str.replace(/[rn]*/g, ”);
    str = str.replace(/^([s]*)([wW]+)/, ‘$1’ + start_tag + ‘$2’ + end_tag + ‘rn’);
    var cp = str.indexOf(start_tag);
    document.selection.Text = str;
    document.selection.CharLeft(false, str.length – cursorFix);
    document.selection.StartOfLine();
    document.selection.CharRight(false, cp + start_tag.length);
    return;
    }
    }
    else {
    word = start_tag + word.replace(/r*n/g, end_tag + ‘rn’ + start_tag) + end_tag;
    document.selection.Text = word;
    return;
    }

    })();

    :-D :-D

    #8096
    horatio
    Member

    EmEditor Macro Error:

    Expected ‘;’

    File: [path]

    Line: 1

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.