Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

Control.TextArea wrapSelection "double-effect" patch

#44

Current situation:

Select text, click bold. The selection is now surrounded by markdown for bold. Select the same region of text, click bold again. The selection is now "double-bolded." In most rich text editors, the effect would be to remove the bold.

Ergo, textarea.js wrapSelection could be implemented as:


var sel = this.getSelection();
if (sel.indexOf(before) == 0 && sel.lastIndexOf(after) == (sel.length - after.length)) {
    this.replaceSelection(sel.substring(before.length,sel.length - after.length));
} else {
    this.replaceSelection(before + sel + after);
}

Reported by JamLegend · January 20th, 2009 @ 08:38 PM

State: resolved
Milestone: 1.0
Assigned to: Ryan Johnson Ryan Johnson

Activity

  1. Nathan L Smith
    Nathan L Smith
    • State changed from unconfirmed to confirmed

    May 21st, 2009 @ 08:12 PM

  2. Nathan L Smith
    Nathan L Smith
    • State changed from confirmed to resolved

    May 25th, 2009 @ 10:56 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.