Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/otherjoel/txp-markdownlib
Drop-in replacement for Textpattern's classTextile.php using PHP Markdown Lib and HTML Purifier
https://github.com/otherjoel/txp-markdownlib
Last synced: 28 days ago
JSON representation
Drop-in replacement for Textpattern's classTextile.php using PHP Markdown Lib and HTML Purifier
- Host: GitHub
- URL: https://github.com/otherjoel/txp-markdownlib
- Owner: otherjoel
- License: unlicense
- Created: 2014-12-04T02:43:04.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-04T03:22:12.000Z (about 10 years ago)
- Last Synced: 2024-05-10T00:20:25.242Z (8 months ago)
- Language: PHP
- Size: 129 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
txp-markdownlib
===============Allows you to use MarkdownExtra in Textpattern instead of Textile.
Drop-in replacement for Textpattern’s classTextile.php using PHP Markdown Lib, SmartyPants and HTML Purifier. Works with Textpattern 4.5.7 and older.Michel Fortin’s original PHP Markdown code included a file very like this one. Active development, however, has switched to [PHP Markdown Lib](https://michelf.ca/projects/php-markdown/), which (for some reason) no longer includes a drop-in classTextile replacement. So I updated it.
Additionally this version uses [HTML Purifier](http://htmlpurifier.org/download) to prevent inclusion of malicious code, which Michel’s original never did. This is important because Markdown syntax explicitly allows the use of plain HTML, and Michel’s library doesn’t include any measures for ensuring the safety of the HTML it passes through (nor should it, in my opinion; the problem is a huge one and better handled by a separate library). This is not a concern when processing your own blog posts, but Textpattern uses the same engine to process comments.
How to Install
----------------Of course all of this assumes a working [Textpattern][txp] installation.
The `classTextile.php` file included here should replace the one in the `textpattern/lib` folder, and the files from the dependencies below should be placed in subfolders in the same location (except for `smartypants.php` which should go alongside this file):
- MarkdownExtra Lib —
- SmartyPants Typographer —
- HTML Purifier *Standalone distribution* —[txp]: http://textpattern.com