Skip to content

Commit b19b613

Browse files
authored
repo sync
2 parents 3e8ad95 + cdb1e4a commit b19b613

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

javascripts/hyperscript.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ export default function h (tagName, ...children) {
3939
}
4040

4141
export const tags = Object.fromEntries(
42-
['div', 'form', 'a', 'input', 'button', 'ol', 'li', 'em']
42+
['div', 'form', 'a', 'input', 'button', 'ol', 'li', 'mark']
4343
.map(tagName => [tagName, (...args) => h(tagName, ...args)])
4444
)

javascripts/search.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,26 +241,26 @@ function tmplSearchResult ({ url, breadcrumbs, heading, title, content }) {
241241
div(
242242
{ class: 'search-result-breadcrumbs d-block text-gray-dark opacity-60 text-small pb-1' },
243243
// Remove redundant title from the end of breadcrumbs
244-
emify((breadcrumbs || '').replace(` / ${title}`, ''))
244+
markify((breadcrumbs || '').replace(` / ${title}`, ''))
245245
),
246246
div(
247247
{ class: 'search-result-title d-block h4-mktg text-gray-dark' },
248248
// Display page title and heading (if present exists)
249-
emify(heading ? `${title}: ${heading}` : title)
249+
markify(heading ? `${title}: ${heading}` : title)
250250
),
251251
div(
252252
{ class: 'search-result-content d-block text-gray' },
253253
// Truncate without breaking inner HTML tags
254-
emify(truncate(content, maxContentLength))
254+
markify(truncate(content, maxContentLength))
255255
)
256256
)
257257
)
258258
}
259259

260-
// Allow em tags in search responses
261-
function emify (text) {
262-
const { em } = tags
260+
// Convert em to mark tags in search responses
261+
function markify (text) {
262+
const { mark } = tags
263263
return text
264264
.split(/<\/?em>/g)
265-
.map((el, i) => i % 2 ? em(el) : el)
265+
.map((el, i) => i % 2 ? mark(el) : el)
266266
}

0 commit comments

Comments
 (0)