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 %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
{% block scripts %}
|
{% 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(",") %}
|
{% set languages = lang.t('search.languages').split(",") %}
|
||||||
{% if languages | length and languages[0] != "" %}
|
{% if languages | length and languages[0] != "" %}
|
||||||
{% set path = base_url + "/assets/javascripts/lunr" %}
|
{% set path = base_url + "/assets/javascripts/lunr" %}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"footer.next": "Next",
|
"footer.next": "Next",
|
||||||
"meta.comments": "Comments",
|
"meta.comments": "Comments",
|
||||||
"meta.source": "Source",
|
"meta.source": "Source",
|
||||||
"search.languages": "",
|
"search.languages": "ru",
|
||||||
"search.placeholder": "Search",
|
"search.placeholder": "Search",
|
||||||
"search.result.placeholder": "Type to start searching",
|
"search.result.placeholder": "Type to start searching",
|
||||||
"search.result.none": "No matching documents",
|
"search.result.none": "No matching documents",
|
||||||
|
@ -209,7 +209,7 @@ export default class Result {
|
|||||||
|
|
||||||
/* Assemble highlight regex from query string */
|
/* Assemble highlight regex from query string */
|
||||||
const match = new RegExp(
|
const match = new RegExp(
|
||||||
`\\b(${escape(this.value_.trim()).replace(" ", "|")})`, "img")
|
`(?:^|\\s)(${escape(this.value_.trim()).replace(" ", "|")})`, "img")
|
||||||
const highlight = string => `<em>${string}</em>`
|
const highlight = string => `<em>${string}</em>`
|
||||||
|
|
||||||
/* Render results */
|
/* Render results */
|
||||||
|
Loading…
Reference in New Issue
Block a user