Skip to content

Shortcuts autoreplace logic #6

@pinta83

Description

@pinta83

The logic that auto replaces smiley needs some work...
There's a problem if you have a setup like
smileys: [
[
{shortcut: [':-)', ':)'], url: '/media/smileys/smile.png', title: 'smiley'},
{shortcut: ['O:)', 'o:)'], url: '/media/smileys/angel.png', title: 'angel'},
{shortcut: 'o.O', url: '/media/smileys/confused.png', title: 'confused'}
]
]

As you see, the first shortcut defines ':)' for smiley, but if that one is at first place, all other smileys that containt this string will fire the first one..

Example, if you write 'O:)' you will actually end up with ':)', but if you swap definitions like so

smileys: [
[
{shortcut: ['O:)', 'o:)'], url: '/media/smileys/angel.png', title: 'angel'},
{shortcut: 'o.O', url: '/media/smileys/confused.png', title: 'confused'},
{shortcut: [':-)', ':)'], url: '/media/smileys/smile.png', title: 'smiley'}
]
]

everything seems to work.
So it would be good to either make an extra check, or simply fire the auto replace function with a delay of 1 sec or something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions