\Kaloa\Renderer\MarkdownHasher

Summary

Methods
Properties
Constants
hashPart()
hashBlock()
unhash()
getHashByKey()
clear()
No public properties found
No constants found
No protected methods found
$hashes
N/A
No private methods found
No private properties found
N/A

Properties

$hashes

$hashes : array

Stores token to expanded content map

Type

array

Methods

hashPart()

hashPart(string  $text, string  $boundary = 'X') : string

Called whenever a tag must be hashed when a function insert an atomic element in the text stream. Passing $text to through this function gives a unique text-token which will be reverted back when calling unhash.

The $boundary argument specify what character should be used to surround the token. By convension, "B" is used for block elements that needs not to be wrapped into paragraph tags at the end, ":" is used for elements that are word separators and "X" is used in the general case.

Parameters

string $text
string $boundary

Returns

string —

String that will replace the tag.

hashBlock()

hashBlock(string  $text) : string

Shortcut function for hashPart with block-level boundaries.

Parameters

string $text

Returns

string

unhash()

unhash(string  $text) : string

Swap back in all the tags hashed by _HashHTMLBlocks.

Parameters

string $text

Returns

string

getHashByKey()

getHashByKey(string  $key) : string

Parameters

string $key

Throws

\Exception

Returns

string

clear()

clear() 

Removes all stored hashes.