Skip to content

Commit 65117c8

Browse files
authored
Merge pull request #23 from selfagency/dev
2 parents f917e12 + f2ab9da commit 65117c8

File tree

4 files changed

+8274
-33044
lines changed

4 files changed

+8274
-33044
lines changed

action.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@ import core from '@actions/core';
22
import { createHash } from 'crypto';
33
import dayjs from 'dayjs';
44
import { readFile, writeFile } from 'fs';
5+
import html2md from 'html-to-md';
56
import { compile } from 'html-to-text';
67
import fetch from 'node-fetch';
78
import { parse } from 'rss-to-json';
8-
import TurndownService from 'turndown';
99
import { promisify } from 'util';
1010

1111
const read = promisify(readFile);
1212
const write = promisify(writeFile);
1313
const { debug, setFailed, getInput } = core;
14-
const turndownService = new TurndownService();
1514
const html2txt = compile({
1615
wordwrap: 120
1716
});
@@ -104,8 +103,7 @@ const run = async () => {
104103
if (!unfurl) {
105104
if (item.title) text += `*${html2txt(item.title)}*\n`;
106105
if (item.description) {
107-
const description = turndownService
108-
.turndown(item.description)
106+
const description = html2md(item.description)
109107
.replace(/[Rr]ead more/g, '…')
110108
.replace(/\n/g, ' ');
111109
text += `${description}\n`;

0 commit comments

Comments
 (0)