Texy! 
Texy is text-to-HTML formatter and converter library written in PHP. It allows
you to write structured documents (with images, links, nested lists, tables) without
knowledge or using of HTML language. You write documents in humane easy-to-read
plain text format and Texy! converts it to structurally and valid HTML code.
Texy formats text in accordance with typographic rules. It replaces quotes
with typographic correct quotes, hyphens with em-dash, converts letter x to
dimension sign etc.
The best way to install Texy is to use a Composer:
php composer.phar require texy/texy
Documentation and Examples
Refer to the 'examples' directory for examples. Texy documentation is
available on the homepage https://texy.info.
If you like Texy, please make a donation now. Thank you!