Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Create a Markdown-it plugin to support embedded videos #2706
Comments
|
@laurent22 I want to work on this, but it seems to be a plugin that already does this, here is it okay to just integrate it into the codebase? |
|
I saw it but it's not good because it unecessarily introduces non standard markup. Perhaps it can be used as a starting point to generate the html markup. |
|
okay, so you basically want the same functionality replicated, but should generate standard markup(semantic HTML)? |
|
No I mean the input Markdown should be standard. The output HTML I don't mind so much as long as it's reasonably clean. Their Markdown looks like this:
But that's not good as it's not standard and, if the plugin is not enabled, it won't work at all. So our Markdown should look like this:
which is standard. It's actually even easier to implement since markdown-it already parses this by default. You'll need to hook into link_open I think. |
okay, I will give this a try |
Do you mean to install the plugin then open the plugin's source code where the link destination is parsed and then only keep the code with accepts the standard format? |
I'm not sure what you mean. You're free to start from that existing plugin if you want. But to be honest the bulk of the work will be in detecting and parsing the YouTube URL and this is not in the existing plugin. Maybe start from scratch with a new plugin, and copy/paste the parts of the other plugin that might be useful (in particular the part to render the YouTube HTML code). |
|
@laurent22 I read the conversation in the @Rishgod 's PR. Can i still work on this issue? |
|
Considering the last PR wasn't merged can I work on this issue? If I can then can you give me any clue how I should approach solving this issue? |
|
Yeah sure. I am not working on that currently.
…On Sat, Aug 29, 2020, 11:05 AM Koushik Sahu ***@***.***> wrote:
Considering the last PR wasn't merged can I work on this issue?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2706 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK7TM42IVYOZFNS3NUIRPJ3SDCHT5ANCNFSM4LEP2UBQ>
.
|


Videos would be embedded like so:
So it is valid Markdown that works as a simple link by default.
However, when the plugin is enabled, it would parse the Markdown links in the page and, when it is a video, display a video player. For now, we only need to support YouTube, but the code should be generic enough to add more video platforms later on.