Skip to content

Allow html content in selection template#6311

Open
5andr0 wants to merge 1 commit into
select2:developfrom
5andr0:template-fix
Open

Allow html content in selection template#6311
5andr0 wants to merge 1 commit into
select2:developfrom
5andr0:template-fix

Conversation

@5andr0
Copy link
Copy Markdown

@5andr0 5andr0 commented May 9, 2024

Applying the same logic, which was already implemented for the result template, where only strings are HTML escaped. Now the user does not have to overwrite escapeMarkup when passing html content from templateSelection. Also fixed the typecheck of strings, because typeof new String("") is 'object' and not 'string'.

This pull request includes a

  • Bug fix
  • New feature
  • Translation

The following changes were made

  • Fixing a bug, where String objects are not escaped because typeof new String("") is 'object', not 'string'
  • Only escape template strings for selection aswell

Applying the same logic, which was already implemented for the result template, where only strings are HTML escaped.
Now the user does not have to overwrite escapeMarkup when passing html content from templateSelection.
Also fixed the typecheck of strings, because typeof String is Object and not string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant