Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

HTML entities in $select.search not handled #846

@gklandes

Description

@gklandes

if the value to be displayed in the dropdown is not allowed by $sanitize it is removed. We ran into this when testing a list that included an item, ''.

The behavior is that the 'unsafe' portion of item is stripped. In another test case, the value 'aa' was rendered as 'aa' in the dropdown.

Our test case would be:

describe('"highlight" filter', function () {
  var highlightFilter;
  beforeEach(module('ui.select'));
  beforeEach(inject(function ($filter) {
    highlightFilter = $filter('highlight');
  }));
  it('should work correctly for html entities', function () {
    expect(highlightFilter('before <match> after', 'nomatch')).toEqual('before &lt;match&gt; after');
    expect(highlightFilter('before <match> after', '<match>')).toEqual('before <span class="ui-select-highlight">&lt;match&gt;</span> after');
  });
});

We have experimented with a number of solutions including http://codepen.io/gklandes/pen/QwXeXW. But do not have anything suitable for a pull request at this point.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions