fix: formatting

This commit is contained in:
Cory Dransfeldt 2024-09-24 13:35:14 -07:00
parent ad81eb050c
commit 3d97366667
No known key found for this signature in database
3 changed files with 13 additions and 4 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "coryd.dev",
"version": "24.19.10",
"version": "24.19.11",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "coryd.dev",
"version": "24.19.10",
"version": "24.19.11",
"license": "MIT",
"dependencies": {
"@cdransf/api-text": "^1.5.0",

View file

@ -1,6 +1,6 @@
{
"name": "coryd.dev",
"version": "24.19.10",
"version": "24.19.11",
"description": "The source for my personal site. Built using 11ty (and other tools).",
"type": "module",
"scripts": {

View file

@ -30,7 +30,16 @@ async function handleMastodonPost(env) {
if (existingPost) continue
const plainTextDescription = convert(item.description)
const plainTextDescription = convert(item.description, {
wordwrap: false,
selectors: [
{ selector: 'a', options: { ignoreHref: true } },
{ selector: 'h1', options: { uppercase: false } },
{ selector: 'h2', options: { uppercase: false } },
{ selector: 'h3', options: { uppercase: false } },
{ selector: '*', format: 'block' }
]
})
const content = `${item.title}\n\n${plainTextDescription}\n\n${item.link}`
await postToMastodon(mastodonApiUrl, accessToken, content)