Skip to content

[suggestion] ctrl+g behavior #137

Closed
Closed
@jakekwak

Description

@jakekwak
Contributor

ctrl+g like ctrl+b, ctrl+i, and ctrl+s

exampe : ctrl+g, test, ctrl+g, test test

inline code

Activity

jakekwak

jakekwak commented on Feb 23, 2020

@jakekwak
ContributorAuthor

toolbarEvents.ts

line 105

        if (tagName === "S" || tagName === "STRONG" || tagName === "EM" || tagName === "CODE") {
            let insertHTML = "";
            if (text.substr(0, offset) !== "" && text.substr(0, offset) !== Constants.ZWSP || previousHTML) {
                insertHTML = `<${tagName}>${lastTagName}${previousHTML}${text.substr(0, offset)}${lastEndTagName}</${tagName}>`;
            }
            if ((commandName === "bold" && tagName === "STRONG") ||
                (commandName === "italic" && tagName === "EM") ||
                (commandName === "inline-code" && tagName === "CODE") ||
                (commandName === "strikeThrough" && tagName === "S")) {
                insertHTML += `${lastTagName}${Constants.ZWSP}<wbr>${lastEndTagName}`;
                jump = true;

line 302

            if (range.toString() === "" && (commandName === "bold" || commandName === "italic" 
                || commandName === "strikeThrough" || commandName === "inline-code")) {
                let tagName = "strong";
                if (commandName === "italic") {
                    tagName = "em";
                } else if (commandName === "strikeThrough") {
                    tagName = "s";
                } else if (commandName === "inline-code")   {
                    tagName = "code";
                }

line 3 commnet
line 170-176 comment
line 221-235 comment

self-assigned this
on Feb 24, 2020
added this to the 2.2 milestone on Feb 24, 2020
Vanessa219

Vanessa219 commented on Feb 24, 2020

@Vanessa219
Owner

Thx, we will fix it in 2.2.x.

jakekwak

jakekwak commented on Feb 28, 2020

@jakekwak
ContributorAuthor
Vanessa219

Vanessa219 commented on Feb 28, 2020

@Vanessa219
Owner

toggle code, select all is not good?

added a commit that references this issue on Apr 8, 2020
239fa0a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @Vanessa219@jakekwak

      Issue actions

        [suggestion] ctrl+g behavior · Issue #137 · Vanessa219/vditor