Skip to content

Issue with quotes #22

Open
Open
@bramdebouvere

Description

@bramdebouvere

When you select a text that contains quotes, only the part before the quote is inserted in the textbox.
Example text:

This is "text" with quotes

After selecting the value, only the following text will be in the textbox

This is

This issue should be fixed in the renderItem function:

function (item, search)
{
  // escape special characters
  search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  var re = new RegExp("(" + search.split(' ').join('|') + ")", "gi");
  return '<div class="autocomplete-suggestion" data-val="' + item + '">' + item.replace(re, "<b>$1</b>") + '</div>';
}

Change this code:

'<div class="autocomplete-suggestion" data-val="' + item + '">'

To this code:

'<div class="autocomplete-suggestion" data-val="' + item.replace(/"/g, '&quot;') + '">'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions