Skip to content

Problem when selecting and trying to detect if it is bold, italic or both in textarea #2

@Inbydev

Description

@Inbydev

Visual of the problem

text added:
*test*

detected:
Italic

correct detection:
Italic

Visual:
imagen

text added:
**test**

detected:
Bold and Italic

correct detection:
Bold

Visual:
imagen

text added:
***test***

detected:
Bold and Italic

correct detection:
Bold and Italic

Visual:
imagen

The problem is in the second case, because it only needs to detect bold and not italics.

I think it's for this part of the code word.js:

function containsItalic(text) {
    return text.includes("*");
}

function containsBold(text) {
    return text.includes("**");
}

need a better solution, but I really don't know what to do to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions