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

Use matched substring in Spotify liquid tag to avoid trailing whitespace #10953

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

The bug was caused by a trailing whitespace character in the embed URL. Using the matched substring from MatchData avoids any additional whitespace. Also updated the spec to use explicit values instead of duplicating the logic from the code.

Related Tickets & Documents

Closes #10951

QA Instructions, Screenshots, Recordings

Adding a Spotify liquid tag to an Article will now result in a valid embed iframe, while before it would display the text "Bad Request".

For example:

{% spotify spotify:track:3GfOAdcoc3X5GPiiXmpBjK %}

Before:
forem_spotify_before

After:
forem_spotify_after

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 20, 2020
@rhymes rhymes self-requested a review October 20, 2020 16:31
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 @tudorpavel!

@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
@rhymes rhymes requested review from a team and msarit October 20, 2020 17:02
@benhalpern benhalpern merged commit fa39a7e 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 fix-spotify-liquid-tag branch October 20, 2020 17:44
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.

Spotify liquid tags showing as 'bad request' in article preview and when published.
3 participants