File tree 4 files changed +11
-21
lines changed 4 files changed +11
-21
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ const https = require('https')
3
3
4
4
jest . mock ( '@actions/core' )
5
5
jest . mock ( '@actions/github' )
6
- jest . mock ( 'turndown ' )
6
+ jest . mock ( 'html-to-md ' )
7
7
8
8
const core = require ( '@actions/core' )
9
9
const { getOctokit, context } = require ( '@actions/github' )
Original file line number Diff line number Diff line change 1
1
const core = require ( '@actions/core' )
2
2
const { getOctokit, context } = require ( '@actions/github' )
3
3
const RSSParser = require ( 'rss-parser' )
4
- const TurnDown = require ( 'turndown ' )
4
+ const html2md = require ( 'html-to-md ' )
5
5
6
6
const parseDurationInMilliseconds = ( text ) => {
7
7
let ms = 0
@@ -43,7 +43,7 @@ const run = async () => {
43
43
const octokit = getOctokit ( core . getInput ( 'github-token' ) )
44
44
45
45
// Instantiate feed parser
46
- const feed = await ( new RSSParser ( ) ) . parseURL ( core . getInput ( 'feed' ) )
46
+ const feed = await ( new RSSParser ( { xml2js : { trim : true } } ) ) . parseURL ( core . getInput ( 'feed' ) )
47
47
core . info ( feed && feed . title )
48
48
if ( ! feed . items || feed . items . length === 0 ) return
49
49
@@ -58,8 +58,6 @@ const run = async () => {
58
58
} )
59
59
core . debug ( `${ issues . length } issues` )
60
60
61
- const turndownService = new TurnDown ( )
62
-
63
61
const createdIssues = [ ]
64
62
65
63
// Iterate
@@ -91,7 +89,7 @@ const run = async () => {
91
89
continue
92
90
}
93
91
94
- let markdown = turndownService . turndown ( content )
92
+ let markdown = html2md ( content )
95
93
96
94
// truncate if characterLimit > 0
97
95
if ( characterLimit && markdown . length > characterLimit ) {
Original file line number Diff line number Diff line change 28
28
"dependencies" : {
29
29
"@actions/core" : " ^1.10.0" ,
30
30
"@actions/github" : " ^4.0.0" ,
31
- "rss-parser " : " ^3.12.0 " ,
32
- "turndown " : " ^7.0 .0"
31
+ "html-to-md " : " ^0.5.3 " ,
32
+ "rss-parser " : " ^3.12 .0"
33
33
},
34
34
"devDependencies" : {
35
35
"@vercel/ncc" : " ^0.28.2" ,
You can’t perform that action at this time.
0 commit comments