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

Bug/fixes links without http(s) #4155

Merged
merged 8 commits into from
Oct 7, 2019
Merged

Bug/fixes links without http(s) #4155

merged 8 commits into from
Oct 7, 2019

Conversation

Amorpheuz
Copy link
Contributor

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

  • Refactor
  • Feature
  • Bug Fix
  • Documentation Update

Description

Fix invalid links in article/comments due to absence of http/https

  • updates app>lin>redcarpet>render>html_rouge.rb
  • checks if a link added to article or comment by author contains https:// or http:// or is nil.
    • If true keeps link as is.
    • If false appends // to the link in order to prevent it from appending to dev.to's url.

Related Tickets & Documents

#4101

Added to documentation?

  • docs.dev.to
  • readme
  • no documentation needed

[optional] What gif best describes this PR or how it makes you feel?

Figured out a way to test WSL changes via travis 🎉. After ditching a previous branch, hehe.
yay!

@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Sep 30, 2019
Copy link
Contributor

@rhymes rhymes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @Amorpheuz, in addition to improving the regexp I suggest you add tests about this, being such a crucial part of the rendering process.

You can add specs to https://github.com/thepracticaldev/dev.to/blob/master/spec/labor/markdown_parser_spec.rb which uses this class to render things

app/lib/redcarpet/render/html_rouge.rb Outdated Show resolved Hide resolved
@pr-triage pr-triage bot added PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 1, 2019
@maestromac maestromac self-assigned this Oct 2, 2019
@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes labels Oct 2, 2019
@maestromac maestromac requested a review from rhymes October 3, 2019 19:48
app/lib/redcarpet/render/html_rouge.rb Outdated Show resolved Hide resolved
@pr-triage pr-triage bot added PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 4, 2019
@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes labels Oct 5, 2019
@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 5, 2019
@maestromac maestromac merged commit 328d27f into forem:master Oct 7, 2019
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Oct 7, 2019
@Amorpheuz Amorpheuz deleted the bug/fixes-links-without-http(s) branch October 7, 2019 14:58
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.

3 participants