Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve newlines and indentation in <pre> tags from RSS import #10922

Merged
merged 1 commit into from Oct 20, 2020

Conversation

tudorpavel
Copy link
Contributor

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

I tracked down the issue to the reverse_markdown gem and found this unmerged fix: xijo/reverse_markdown#78. Since it seems we are already overriding the <pre> converter I went ahead and added the fix to our CustomPre implementation, together with a simple spec.

Related Tickets & Documents

Closes #10104

QA Instructions, Screenshots, Recordings

I tested using the sample RSS feed provided in the issue.

The easiest way I found for me to test the feed parsing was to create a draft Article and then from rails console perform an update with the code from RssReader:

feed = Feedjira.parse(File.read('sample_rss.xml'))

Article.last.update(
  body_markdown: RssReader::Assembler.call(feed.entries.first, User.find(4), feed, feed.entries.first.url.strip.split("?source=")[0])
)

Added tests?

  • yes
  • no, because they aren't needed
  • no, because I need help

Added to documentation?

  • docs.forem.com
  • readme
  • no documentation needed

@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Oct 19, 2020
@pr-triage pr-triage bot added PR: partially-approved bot applied label for PR's where a single reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 20, 2020
@benhalpern benhalpern merged commit 52cf816 into forem:master Oct 20, 2020
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: partially-approved bot applied label for PR's where a single reviewer approves changes labels Oct 20, 2020
@tudorpavel tudorpavel deleted the markdown-newlines-pre-tag branch October 20, 2020 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Code blocks lose indentation when imported through RSS
3 participants