New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

adhocore/htmlup

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adhocore/htmlup

HTML from Markdown.

Source
Packagist
This package is abandoned and is no longer maintained.
The author recommends using true instead.
This version has been yanked by its maintainers and should not be used.
Version
0.2.1
Version published
Total downloads
53
Maintainers
1
Created
Source

adhocore/htmlup

Latest Version Travis Build Scrutinizer CI Codecov branch StyleCI Software License

htmlup is ultra lightweight and uber speedy markdown to html parser written in PHP. Concept - it splits the markdown into lines and parses to markup one by one, finally applies markdown syntaxes on the markup. It supports most of the markdown as in specs.

installation

Run composer require adhocore/htmlup

usage

<?php

use Ahc\HtmlUp;

// require '/path/to/vendor/autoload.php';

// Defaults to 4 space indentation.
echo new Ahc\HtmlUp($markdownText);

// Force 2 space indentation.
echo new HtmlUp($markdownText, 2);

// Also possible:
echo (new Htmlup)->parse($markdownText);

features

nesting

It provides limited support to deep nested elements, supported items are:

  • lists inside lists
  • blockquotes inside blockcodes
  • lists inside blockquotes

raw html

you can throw in your raw html but with a blank line at start and end to delimit the block at like so-


<dl>
  <dt>
  	A
  </dt>
  <dd>Apple
  	</dd>
  	<dt>B
  </dt>
  <dd>
  Ball</dd>
</dl>

table

supports GFM table syntax, example:

a | b | c
--- |----| ---
1 | 2  |3
 4| 5 | 6

is rendered as:

abc
123
456

todo

  • make robust, and provide full support of spec
  • handle markdown table syntax
  • markdown extra however, is not planned :(

contributing

  • fork and pull request for patch/fix
  • create issue for breaking bugs and severe markdown spec violation
  • please check the guide

license

© MIT | 2014-2018, Jitendra Adhikari

Keywords

markdown

FAQs

Package last updated on 01 Sep 2018

Related posts