Trim whitespace in XML nodes and improve Markdown conversion #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, I found 2 issues when using this action.
The beginning and end of an XML node may contain newline and whitespace, e.g. https://github.com/git-for-windows/rss-to-issues/commits.atom
If don't provide an option
{ xml2js: { trim: true } }to rss-parser, title will be\n Bump to v0.0.3\n.When creating issue, GitHub will ignore all
\n, and issue title will beBump to v0.0.3.This causes the condition below to always be false and issues will be created continuously.
rss-to-issues/index.js
Lines 76 to 79 in b014aba
Another issue I found is turndown will not convert
<pre>to Markdown code block, which guilhem/rss-issues-action will.I tried to extending turndown's rules but broken by its aggressive escaping rules.
So finally I use html-to-md instead of turndown, this works fine for me.
If you don’t like it, please let me know and I will rollback it.