PHPackages                             gcdinsmore/markdown-it-youtube-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. gcdinsmore/markdown-it-youtube-php

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

gcdinsmore/markdown-it-youtube-php
==================================

YouTube Markdown plugin for markdown-it-php

v1.0.0(4y ago)010MITPHPPHP &gt;=7.4.0

Since Jan 2Pushed 4y ago1 watchersCompare

[ Source](https://github.com/gcdinsmore/markdown-it-youtube-php)[ Packagist](https://packagist.org/packages/gcdinsmore/markdown-it-youtube-php)[ Docs](https://github.com/gcdinsmore/markdown-it-youtube-php)[ RSS](/packages/gcdinsmore-markdown-it-youtube-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

markdown-it-youtube-php
=======================

[](#markdown-it-youtube-php)

This is a plugin for the [markdown-it-php Markdown parser](https://github.com/kaoken/markdown-it-php/) by Kenji Yasuda. It allows you to easily embed YouTube videos into your Markdown enabled website, without allowing HTML.

**Table of Contents**

- [Install](#install)
- [Syntax](#syntax)
- [License](#license)

Install
-------

[](#install)

**composer**:

```
composer require gcdinsmore/markdown-it-youtube-php
```

### Simple

[](#simple)

```
use Kaoken\MarkdownIt\MarkdownIt;
use GCDinsmore\YoutubeIt\YoutubeIt;

$md = new MarkdownIt();
$md->plugin(new YoutubeIt());
echo $md->render("!yt[](sk2pr4XD_kw)");
```

### Init with options

[](#init-with-options)

```
$md = new MarkdownIt();
$md->plugin(new YoutubeIt([
	"width" => "200px",
	"height" => "200px",
	"origin" => "https://example.com"
]));
echo $md->render("!yt[](sk2pr4XD_kw)");
```

### Details of the options

[](#details-of-the-options)

OptionDefaultDescriptionclassSpecify a class attribute for the iframe. Use this to style iframes.height480pxThe height attribute of the YouTube iframeoriginThis is the origin argument of the embedded URL. According to [YouTube](https://developers.google.com/youtube/iframe_api_reference), this can help prevent malicious JavaScript from hijacking your YouTube videos.width270pxThe width attribute of the YouTube iframeSyntax
------

[](#syntax)

YoutubeIt syntax is similar to the standard image Markdown syntax, except you add **yt** after the initial exclamation point. The text inside the square brackets is used as the alt text. The optional text after the URL is used as the title.

The URL portion can be just the video ID, or it can be the URL from the YouTube page.

```
!yt[Lady Washington](https://www.youtube.com/watch?v=4YBB1VXg_hk "Lady Washington from SailingNW.com")

```

The reference style syntax is supported as well.

```
!yt[S/V Audrey II][1]
Some text
- a
- b

[1]: sk2pr4XD_kw \"S/V Audrey II Adventure\"

```

License
-------

[](#license)

I'm using the same [MIT](https://github.com/gcdinsmore/markdown-it-youtube-php/blob/main/LICENSE) license that markdown-it and markdown-it-php are using.

###  Health Score

23

—

LowBetter than 25% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1687d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/45550394?v=4)[SaltyGeek](/maintainers/gcdinsmore)[@gcdinsmore](https://github.com/gcdinsmore)

---

Top Contributors

[![gcdinsmore](https://avatars.githubusercontent.com/u/45550394?v=4)](https://github.com/gcdinsmore "gcdinsmore (4 commits)")

---

Tags

commonmarkmarkdownmarkdown-itphpyoutubemarkdownyoutube

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gcdinsmore-markdown-it-youtube-php/health.svg)

```
[![Health](https://phpackages.com/badges/gcdinsmore-markdown-it-youtube-php/health.svg)](https://phpackages.com/packages/gcdinsmore-markdown-it-youtube-php)
```

###  Alternatives

[erusev/parsedown

Parser for Markdown.

15.1k158.5M922](/packages/erusev-parsedown)[league/commonmark

Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)

3.0k450.4M1.2k](/packages/league-commonmark)[michelf/php-markdown

PHP Markdown

3.5k55.2M397](/packages/michelf-php-markdown)[league/html-to-markdown

An HTML-to-markdown conversion helper for PHP

1.9k33.5M370](/packages/league-html-to-markdown)[cebe/markdown

A super fast, highly extensible markdown parser for PHP

1.0k34.6M156](/packages/cebe-markdown)[zoon/commonmark-ext-youtube-iframe

Extension for league/commonmark to replace youtube link with iframe

12286.0k1](/packages/zoon-commonmark-ext-youtube-iframe)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
