mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed search highlighting for non-latin languages
This commit is contained in:
parent
974f07ccb4
commit
d17b0fbb90
File diff suppressed because one or more lines are too long
@ -149,7 +149,7 @@
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% block scripts %}
|
||||
<script src="{{ base_url }}/assets/javascripts/application-71e40776cb.js"></script>
|
||||
<script src="{{ base_url }}/assets/javascripts/application-1906b41020.js"></script>
|
||||
{% set languages = lang.t('search.languages').split(",") %}
|
||||
{% if languages | length and languages[0] != "" %}
|
||||
{% set path = base_url + "/assets/javascripts/lunr" %}
|
||||
|
@ -5,7 +5,7 @@
|
||||
"footer.next": "Next",
|
||||
"meta.comments": "Comments",
|
||||
"meta.source": "Source",
|
||||
"search.languages": "",
|
||||
"search.languages": "ru",
|
||||
"search.placeholder": "Search",
|
||||
"search.result.placeholder": "Type to start searching",
|
||||
"search.result.none": "No matching documents",
|
||||
|
@ -209,7 +209,7 @@ export default class Result {
|
||||
|
||||
/* Assemble highlight regex from query string */
|
||||
const match = new RegExp(
|
||||
`\\b(${escape(this.value_.trim()).replace(" ", "|")})`, "img")
|
||||
`(?:^|\\s)(${escape(this.value_.trim()).replace(" ", "|")})`, "img")
|
||||
const highlight = string => `<em>${string}</em>`
|
||||
|
||||
/* Render results */
|
||||
|
Loading…
Reference in New Issue
Block a user