Parsedown
- Laravel Package Development - E07 - Parsing The Body Using The PHP Parsedown Library
- Erusev/parsedown - Packagist
Fedora 29: php-erusev-parsedown (2019-b02e9bf467) medium Nessus Plugin ID 122628. Vulnerability Priority Rating (VPR) Tenable calculates a dynamic VPR for every vulnerability. VPR combines vulnerability information with threat intelligence and machine learning algorithms to predict which vulnerabilities are most likely to be exploited in.
- Parsedown Extra Plugin Project ID: 8530190. Star 0 7 Commits; 1 Branch; 3 Tags; 164 KB Files; 215 KB Storage; 2 Releases; ParsedownExtraPlugin Textformatter.
- DWQA Questions › Category: Program › Install Parsedown using composer and prompt Parsedown not found when used in Laravel 0 Vote Up Vote Down Xiaobian puff asked 2 years ago I just started to learn PHP development and did a hands-on project by the way. I am using Laravel and composer to build the development.
Parsedown Extreme is a extension to Parsedown Extra to add even more functions to the library. Spotify macos.
Extentions included in ParsedownExtreme
Installation
- Download the 'Source code' from the latest release
- Include
ParsedownExtreme.php
- You must include
parsedown.php
andparsedownExtra.php
too.
Example
New Features
See all new features below
Task list
Default enabled
Example
- ToDos
- Buy some salad
- Brush teeth
- Drink some water
Superscript & Subscript
To toggle Superscript & Subscript you most call $ParsedownExtreme->superscript('true'|'false')
Default:disabled
Example
Insert and mark
To toggle insert you most call $ParsedownExtreme->insert('true'|'false')
and $ParsedownExtreme->mark('true'|'false')
for mark
Default:enabled
Example
Video embeding
Video embeding support Youtube, Vimeo and Dailtmotion
To toggle Video embeding you most call $ParsedownExtreme->embeding('true'|'false')
Default:true
Example
Typograpic shurtcodes
To toggle Typograpic shurtcodes you most call $ParsedownExtreme->typography('true'|'false')
Default:disabled
Example
(c) (C) (r) (R) (tm) (TM)
(La)KaTeX
To enable KaTeX you must download katex
To toggle KaTeX you most call $ParsedownExtreme->katex('true'|'false')
Default:disabled
Example
Mermaid
To enable Mermaid download Mermaid and use $ParsedownExtreme->mermaid('true'|'false')
to enable it
Default:disabled
Example
Laravel Package Development - E07 - Parsing The Body Using The PHP Parsedown Library
Maintainers
Details
Installs: 78 232 647
Dependents: 690
Suggesters: 34
Security: 2
Stars: 13 603
Watchers: 223
Erusev/parsedown - Packagist
Forks: 1 007
Open Issues: 121
Requires (Dev)
- phpunit/phpunit: ^4.8.35
Suggests
None
Provides
None
Conflicts
None
This package is auto-updated.
Last update: 2021-04-09 15:27:23 UTC
Better Markdown Parser in PHP - Demo.
Features
- One File
- No Dependencies
- Extensible
- Tested in 5.3 to 7.3
Installation
Install the composer package:
Or download the latest release and include Parsedown.php
Example
You can also parse inline markdown only:
More examples in the wiki and in this video tutorial.
Security
Parsedown is capable of escaping user-input within the HTML that it generates. Additionally Parsedown will apply sanitisation to additional scripting vectors (such as scripting link destinations) that are introduced by the markdown syntax itself.
To tell Parsedown that it is processing untrusted user-input, use the following:
If instead, you wish to allow HTML within untrusted user-input, but still want output to be free from XSS it is recommended that you make use of a HTML sanitiser that allows HTML tags to be whitelisted, like HTML Purifier.
In both cases you should strongly consider employing defence-in-depth measures, like deploying a Content-Security-Policy (a browser security feature) so that your page is likely to be safe even if an attacker finds a vulnerability in one of the first lines of defence above.
Security of Parsedown Extensions
Safe mode does not necessarily yield safe results when using extensions to Parsedown. Extensions should be evaluated on their own to determine their specific safety against XSS.
Escaping HTML
WARNING: This method isn't safe from XSS!
If you wish to escape HTML in trusted input, you can use the following:
Beware that this still allows users to insert unsafe scripting vectors, such as links like [xss](javascript:alert%281%29)
.
Questions
How does Parsedown work?
It tries to read Markdown like a human. First, it looks at the lines. It’s interested in how the lines start. This helps it recognise blocks. It knows, for example, that if a line starts with a -
then perhaps it belongs to a list. Once it recognises the blocks, it continues to the content. As it reads, it watches out for special characters. This helps it recognise inline elements (or inlines).
We call this approach 'line based'. We believe that Parsedown is the first Markdown parser to use it. Since the release of Parsedown, other developers have used the same approach to develop other Markdown parsers in PHP and in other languages.
Is it compliant with CommonMark?
It passes most of the CommonMark tests. Most of the tests that don't pass deal with cases that are quite uncommon. Still, as CommonMark matures, compliance should improve.
Who uses it?
Laravel Framework, Bolt CMS, Grav CMS, Herbie CMS, Kirby CMS, October CMS, Pico CMS, Statamic CMS, phpDocumentor, RaspberryPi.org, Symfony Demo and more.
How can I help?
Use it, star it, share it and if you feel generous, donate.
What else should I know?
I also make Nota — a writing app designed for Markdown files :)