Skip to content

Commit 24d9c3a

Browse files
committed
updating algolia headers sectioning records
1 parent f0a083d commit 24d9c3a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

script/search/parse-page-sections-into-records.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This module takes cheerio page object and divides it into sections
2-
// using H1,h2,h3 heading elements as section delimiters. The text
2+
// using H1,H2 heading elements as section delimiters. The text
33
// that follows each heading becomes the content of the search record.
44

55
const { chain } = require('lodash')
@@ -36,7 +36,7 @@ module.exports = function parsePageSectionsIntoRecords (href, $) {
3636

3737
let records
3838

39-
const $sections = $('.article-grid-body h3')
39+
const $sections = $('.article-grid-body h2')
4040
.filter('[id]')
4141
.filter((i, el) => {
4242
return !ignoredHeadingSlugs.includes($(el).attr('id'))
@@ -52,7 +52,7 @@ module.exports = function parsePageSectionsIntoRecords (href, $) {
5252
const content = $(el)
5353
// Platform-specific content is nested in a DIV
5454
// GraphQL content in nested in two DIVS
55-
.nextUntil('h2, h3, div > h2, div > h3, div > div > h2, div > div > h3')
55+
.nextUntil('h2, div > h2, div > div > h2')
5656
.map((i, el) => $(el).text())
5757
.get()
5858
.join(' ')

0 commit comments

Comments
 (0)