mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-23 14:23:39 -04:00
Fixed errors in merge
This commit is contained in:
@@ -75,22 +75,13 @@ function renderArticleDocument(
|
||||
{ location, title, text, terms, score }: SearchDocument & SearchMetadata,
|
||||
teaser: boolean
|
||||
) {
|
||||
|
||||
const highlight: string[] = []
|
||||
for (const [value, found] of Object.entries(terms))
|
||||
if (found)
|
||||
highlight.push(value)
|
||||
|
||||
const url = new URL(location)
|
||||
url.searchParams.append("h", highlight.join(" "))
|
||||
|
||||
const miss = Object.keys(terms)
|
||||
// tslint:disable-next-line: array-type
|
||||
.reduce<Array<Element | string>>((list, key) => [
|
||||
...list, ...!terms[key] ? [<del>{key}</del>, " "] : []
|
||||
], [])
|
||||
return (
|
||||
<a href={url.toString().replace(/%20/g, "+")} class={css.link} tabIndex={-1}>
|
||||
<a href={location.toString().replace(/%20/g, "+")} class={css.link} tabIndex={-1}>
|
||||
<article class={css.article} data-md-score={score.toFixed(2)}>
|
||||
<div class="md-search-result__icon md-icon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
||||
@@ -121,22 +112,13 @@ function renderArticleDocument(
|
||||
function renderSection(
|
||||
{ location, title, text, terms, score }: SearchDocument & SearchMetadata
|
||||
) {
|
||||
|
||||
const highlight: string[] = []
|
||||
for (const [value, found] of Object.entries(terms))
|
||||
if (found)
|
||||
highlight.push(value)
|
||||
|
||||
const url = new URL(location)
|
||||
url.searchParams.append("h", highlight.join(" "))
|
||||
|
||||
const miss = Object.keys(terms)
|
||||
// tslint:disable-next-line: array-type
|
||||
.reduce<Array<Element | string>>((list, key) => [
|
||||
...list, ...!terms[key] ? [<del>{key}</del>, " "] : []
|
||||
], [])
|
||||
return (
|
||||
<a href={url.toString().replace(/%20/g, "+")} class={css.link} tabIndex={-1}>
|
||||
<a href={location.toString().replace(/%20/g, "+")} class={css.link} tabIndex={-1}>
|
||||
<article class={css.section} data-md-score={score.toFixed(2)}>
|
||||
<h1 class={css.title}>{title}</h1>
|
||||
{text.length > 0 &&
|
||||
|
||||
Reference in New Issue
Block a user