mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Merge pull request #266 from squidfunk/fix/search-missing-results
Fixed missing search results when only a h1 is present
This commit is contained in:
commit
7a6acb8a7b
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
material/assets/stylesheets/application-b1a1975878.css
Normal file
1
material/assets/stylesheets/application-b1a1975878.css
Normal file
File diff suppressed because one or more lines are too long
@ -38,7 +38,7 @@
|
||||
<script src="{{ base_url }}/assets/javascripts/modernizr-56ade86843.js"></script>
|
||||
{% endblock %}
|
||||
{% block styles %}
|
||||
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-b168d32589.css">
|
||||
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-b1a1975878.css">
|
||||
{% if config.extra.palette %}
|
||||
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-f78e5cb881.palette.css">
|
||||
{% endif %}
|
||||
@ -150,7 +150,7 @@
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% block scripts %}
|
||||
<script src="{{ base_url }}/assets/javascripts/application-4f7a197d35.js"></script>
|
||||
<script src="{{ base_url }}/assets/javascripts/application-0b7df094bf.js"></script>
|
||||
<script>app.initialize({url:{base:"{{ base_url }}"}})</script>
|
||||
{% for path in extra_javascript %}
|
||||
<script src="{{ path }}"></script>
|
||||
|
@ -179,13 +179,16 @@ export default class Result {
|
||||
if (doc.parent) {
|
||||
const ref = doc.parent.location
|
||||
items.set(ref, (items.get(ref) || []).concat(item))
|
||||
} else {
|
||||
const ref = doc.location
|
||||
items.set(ref, (items.get(ref) || []))
|
||||
}
|
||||
return items
|
||||
}, new Map)
|
||||
|
||||
/* Assemble highlight regex from query string */
|
||||
const match = new RegExp(
|
||||
`\\b(${escape(this.value_.trim().replace(" ", "|"))})`, "img")
|
||||
`\\b(${escape(this.value_.trim()).replace(" ", "|")})`, "img")
|
||||
const highlight = string => `<em>${string}</em>`
|
||||
|
||||
/* Render results */
|
||||
|
@ -443,9 +443,9 @@ $md-toggle__search--checked:
|
||||
}
|
||||
}
|
||||
|
||||
// Add a little spacing on the last link
|
||||
&:last-child {
|
||||
padding-bottom: 0.8rem;
|
||||
// Add a little spacing on the teaser of the last link
|
||||
&:last-child .md-search-result__teaser {
|
||||
margin-bottom: 1.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user