Skip to content

Search terms starting/ending with non-word characters are not highlighted #9

Description

When the search term "2°" (2°) is entered in the search field, the bibliography entries are filtered, but the term is not highlighted in the entries. This is due to the fact that the regex generated from the term in the JS code in openbibl.highlight.js in window.obp.highlight.highlight_term() is like

/\b2°\b/i

which will never match due to the non-word-char/word-boundary combination.

The word boundary assertion should be included only if the end of the search term is a word character.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions