Skip to content

Commit

Permalink
✨ add comment to URL extraction step in archieToEnriched
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesau committed Apr 22, 2024
1 parent 74f9b24 commit 2776e0e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions db/model/Gdoc/archieToEnriched.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
import { convertHeadingTextToId } from "@ourworldindata/components"
import { parseRawBlocksToEnrichedBlocks, parseRefs } from "./rawToEnriched.js"
import urlSlug from "url-slug"
// falls back to `value` if it's not a <a> tag
import { extractUrl, parseAuthors, spansToSimpleString } from "./gdocUtils.js"
import { htmlToSimpleTextBlock } from "./htmlToEnriched.js"
import { RESEARCH_AND_WRITING_DEFAULT_HEADING } from "@ourworldindata/types"
Expand Down Expand Up @@ -309,6 +310,7 @@ export const archieToEnriched = (
for (const key of Object.keys(parsed)) {
const value = parsed[key]
if (typeof value === "string") {
// safe to call on everything because it falls back to `value` if it's not a <a> tag
parsed[key] = extractUrl(value)
}
}
Expand Down

0 comments on commit 2776e0e

Please sign in to comment.