Skip to content

Feature/vimeo tag #409

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

Merged
merged 3 commits into from
Aug 20, 2018
Merged

Feature/vimeo tag #409

merged 3 commits into from
Aug 20, 2018

Conversation

JoshCheek
Copy link
Contributor

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

  • Refactor
  • Feature
  • Bug Fix
  • Documentation Update

Description

There is a tag to render youtube videos (link). But I host on vimeo. This adds an equivalent Vimeo tag.

Note that dropping a vimeo url into it will work also, but there's a wonky thing where the markdown parser turns it into an anchor tag.

Related Tickets & Documents

  • Jess announces the Youtube Tag (link)
  • YoutubeTag's source (link)
  • YoutubeTag's spec (link)

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

Here I change a post's body to have a vimeo tag in it:

screen shot 2018-08-19 at 1 02 15 pm

Here is what it looks like rendered:

screen shot 2018-08-19 at 1 05 14 pm

I haven't looked at it on my phone, but it uses the same dimensions as the YouTube tag, so if that one looks fine, this one should as well.

Added to documentation?

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

screen shot 2018-08-19 at 1 15 07 pm

@CLAassistant
Copy link

CLAassistant commented Aug 19, 2018

CLA assistant check
All committers have signed the CLA.

@benhalpern
Copy link
Contributor

Hell yeah, great contribution Josh. Will merge tomorrow assuming it looks good everywhere.

# My test suite isn't entirely passing, and I've spent longer on this than I
# wanted to, io Instead of looking into those, I'm going to just make this work ¯\_(ツ)_/¯
it "accepts urls that were over-eagerly turned into links by markdown" do
assert_parses id, "<a href=\"https://vimeo.com/#{id}\">https://vimeo.com/192819855</a> "
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I guess with other ones, we sort of hack around this with some.

Markdown parsing should ignore the contents of liquid tags. But since this works the same as the other hacks, we're good to go for this, and the fix is to not autolink the contents of liquid tags.

@benhalpern benhalpern merged commit 4a2a003 into forem:master Aug 20, 2018
@JoshCheek
Copy link
Contributor Author

I looked at the markdown gem to see if it could be extended to understand liquid syntax, but it seemed pretty difficult (they init everything in a function in C, which didn't seem to be extensible). What happens if we run liquid before markdown?

@benhalpern
Copy link
Contributor

@JoshCheek liquid currently runs after markdown so it can include tags that are not whitelisted in the markdown (like iframes and scripts).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants