
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
showdown-youtube
Advanced tools
An extension to embed Youtube videos in showdown documents using markdown syntax
This extension enables embedding youtube videos using markdown's image syntax. Instead of creating a new definition,
it borrows image syntax ![foo][bar.jpg] to create an inframe pointing to the desired video.
Although it uses the same syntax as images, only valid youtube video links are actually parsed.
Basically it looks for urls that start with:
http://www.youtube.com/watch?v= or youtube.com/watch?v=http://www.youtube.com/embed/ or youtube.com/embed/http://youtu.be/ or youtu.be/npm install showdown-youtube
bower install showdown-youtube
You can also download the latest release zip or tarball and include it in your webpage, after showdown:
<script src="showdown.min.js">
<script src="showdown-youtube.min.js">
After including the extension in your application, you just need to enable it in showdown.
var converter = new showdown.Converter({extensions: ['youtube']});
When using in node, ensure to first require the extension so it can register itself with showdown before any converters try to use it.
var showdown = require('showdown');
require('showdown-youtube');
var converter = new showdown.Converter({extensions: ['youtube']});
var converter = new showdown.Converter({extensions: ['youtube']}),
input = '';
html = converter.makeHtml(input);
console.log(html);
This should output the equivalent to:
<iframe src="//www.youtube.com/embed/dQw4w9WgXcQ?rel=0" frameborder="0" allowfullscreen></iframe>
Since youtube extension uses the image syntax for videos, you can set the video dimensions the same way.

This should output the equivalent to:
<iframe width="800px" height="600px" src="//www.youtube.com/embed/dQw4w9WgXcQ?rel=0" frameborder="0" allowfullscreen></iframe>
You can also use units:
 simple, assumes units are in px
 sets the height to "auto"
 width of 80% and height of 5em
Youtube extension reads the options from Showdown Core. So, to pass an option, use the methods explained in Showdown's documentation.
(borrowed from Showdown core)
When using the extension in live editors (for instance, with angularjs), every time the text is changed, a new iframe is created. This leads to a lot of requests done to youtube, which translates as an overall feel of sluggishness. Turning smoothLivePreview on replaces the actual video objects (iframes) with an image placeholder. This way the live editing feels more smooth.
This should only be enabled during live preview and not on the final document.
Only used if smoothLivePreview is on.
Uses a simple black image preview instead of an svg. This is quicker and ensures max compatibility with older browsers.
Default is false
These files are distributed under BSD license. For more information, please check the LICENSE file in the source code.
FAQs
Embed YouTube videos within showdown
The npm package showdown-youtube receives a total of 315 weekly downloads. As such, showdown-youtube popularity was classified as not popular.
We found that showdown-youtube demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.