Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

mdHighlightText - Should allow to highlight string in the middle of the text #1799

@carab

Description

@carab

Hi everyone,

I started using mdAutocomplete in my project, and I was wondering how I could use mdHighlightText properly.

My problem is that this directive only highlights the given string if the text starts with it.
Shouldn't it allow to highlight the string anywhere in the text ?

The easy fix would be to replace this :

var regex = new RegExp('^' + sanitize(term), 'i'),

By this:

var regex = new RegExp(sanitize(term), 'i'),

In the controller code (MdHighlightCtrl).

Actually, the best option would be to allow to use the same comparing function than the one that filters the items in mdAutocomplete... But maybe this will need to much change.

Thank you for your attention !

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions