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

Support for YouTube embed flags #33

Open
chris13524 opened this issue May 17, 2018 · 0 comments
Open

Support for YouTube embed flags #33

chris13524 opened this issue May 17, 2018 · 0 comments

Comments

@chris13524
Copy link

In the README, it says the plugins supports various URL forms, such as "XKFDS?rel=0". However, the plugin ignores these flags when it generates the iframe embed.

I suggest there be some mechanism to use these flags. Directly in the URL would probably be the easiest as it would "only" involve modifying the regex to include these flags in the URL.

@[youtube](https://www.youtube.com/embed/KMU0tzLwhbE?rel=0)
@[youtube](KMU0tzLwhbE?rel=0)
@[youtube](<iframe width="560" height="315" src="https://www.youtube.com/embed/KMU0tzLwhbE?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>)

Another possibility would be to put the flags inside the square brackets. This would be much more readable than the first option, but wouldn't allow directly pasting the embed code.

@[youtube:nosuggest](KMU0tzLwhbE)

A third choice would be to add an entry in the options to modify this behavior globally. But this of course prevents modification of the flags on a case-by-case basis.

var md = require('markdown-it')({
  html: true,
  linkify: true,
  typography: true
}).use(require('markdown-it-video', { // <-- this use(package_name) is required
  youtube: { width: 640, height: 390, suggest: false },
}));

I think the best way would be to support all 3! With the precedence [options](..) -> [..](..?options) -> global

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

No branches or pull requests

1 participant