Skip to content

Commit

Permalink
Merge pull request #23 from selfagency/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
selfagency authored Mar 17, 2022
2 parents f917e12 + f2ab9da commit 65117c8
Show file tree
Hide file tree
Showing 4 changed files with 8,274 additions and 33,044 deletions.
6 changes: 2 additions & 4 deletions action.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ import core from '@actions/core';
import { createHash } from 'crypto';
import dayjs from 'dayjs';
import { readFile, writeFile } from 'fs';
import html2md from 'html-to-md';
import { compile } from 'html-to-text';
import fetch from 'node-fetch';
import { parse } from 'rss-to-json';
import TurndownService from 'turndown';
import { promisify } from 'util';

const read = promisify(readFile);
const write = promisify(writeFile);
const { debug, setFailed, getInput } = core;
const turndownService = new TurndownService();
const html2txt = compile({
wordwrap: 120
});
Expand Down Expand Up @@ -104,8 +103,7 @@ const run = async () => {
if (!unfurl) {
if (item.title) text += `*${html2txt(item.title)}*\n`;
if (item.description) {
const description = turndownService
.turndown(item.description)
const description = html2md(item.description)
.replace(/[Rr]ead more/g, '…')
.replace(/\n/g, ' ');
text += `${description}\n`;
Expand Down
Loading

0 comments on commit 65117c8

Please sign in to comment.