mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-30 17:46:21 -04:00
Replaced use of flat() and max() math function for compatibility
This commit is contained in:
@@ -27,6 +27,7 @@ import {
|
||||
SearchResultItem
|
||||
} from "~/integrations/search"
|
||||
import { h, truncate } from "~/utilities"
|
||||
import { ComponentChild, ComponentChildren } from "preact"
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Helper types
|
||||
@@ -61,8 +62,9 @@ function renderSearchDocument(
|
||||
/* Render missing query terms */
|
||||
const missing = Object.keys(document.terms)
|
||||
.filter(key => !document.terms[key])
|
||||
.map(key => [<del>{key}</del>, " "])
|
||||
.flat()
|
||||
.reduce<ComponentChild[]>((list, key) => [
|
||||
...list, <del>{key}</del>, " "
|
||||
], [])
|
||||
.slice(0, -1)
|
||||
|
||||
/* Assemble query string for highlighting */
|
||||
|
||||
Reference in New Issue
Block a user