Skip to content

Commit

Permalink
convert to apostrophe when importing. Add note about git-lfs
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanLi committed Jan 21, 2024
1 parent 8f195b3 commit 2a8eb5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ pnpm start

Visit http://localhost:3000.

Note: git-lfs needs to be installed. `git lfs install` also needs to be run once – images will otherwise not
be handled by Git LFS.

## Provisioning and deployment

Provisioning is done manually using the `infra/setup.sh` script:
Expand Down
5 changes: 4 additions & 1 deletion scripts/importFromGoogleDocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,15 @@ async function main() {
body.content
.filter(({ paragraph }) => paragraph)
.forEach(({ paragraph }) => {
const { content } = paragraph.elements[0].textRun
let { content } = paragraph.elements[0].textRun

if (content === '\n') {
return
}

// due to react/no-unescaped-entities, single quotes are replaced with an actual apostrophe
content = content.replaceAll(`'`, '’')

const { namedStyleType } = paragraph.paragraphStyle
const headingMatch = namedStyleType.match(/HEADING_(\d)/)

Expand Down

0 comments on commit 2a8eb5a

Please sign in to comment.