Download the PHP package taufik-nurrohman/markdown-filter without Composer
On this page you can find all versions of the php package taufik-nurrohman/markdown-filter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download taufik-nurrohman/markdown-filter
More information about taufik-nurrohman/markdown-filter
Files in taufik-nurrohman/markdown-filter
Package markdown-filter
Short Description Safely replace text in a Markdown document.
License MIT
Homepage https://github.com/taufik-nurrohman/markdown-filter
Informations about the package markdown-filter
PHP Markdown Filter
Motivation
As Markdown has grown in popularity, many people have expected to see new formatting syntaxes added. However, people who develop Markdown parsers will generally stick to the philosophy that John Gruber has explained, that the design goal of Markdown’s formatting syntax is to make it as readable as possible. The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.
Typically, they will simply tell people to use raw HTML syntax if their wishes are too complex and/or not in line with Markdown’s philosophy. Markdown parser generally does not prohibit people from doing so.
People who just know how to search and replace text with PHP often give naive suggestions, such as telling people to use regular expressions to replace text directly in the Markdown document, which often ends up with people replacing text in the wrong places, such as replacing text inside a code block syntax that should be left as it is.
This filter can be used to separate parts of a Markdown document into blocks and spans, so that you can replace text only in certain blocks and spans that you consider safe.
Usage
This converter can be installed using Composer, but
it doesn’t need any other dependencies and just uses Composer’s ability to automatically include files. Those of you who
don’t use Composer should be able to include the index.php
file directly into your application without any problems.
Using Composer
From the command line interface, navigate to your project folder then run this command:
composer require taufik-nurrohman/markdown-filter
Require the generated auto-loader file in your application:
Tests
Clone this repository into the root of your web server that supports PHP and then you can open the test.php
file with
your browser.
License
This library is licensed under the MIT License. Please consider donating 💰 if you benefit financially from this library.