public function setConfig($key, $value)
public function setConfig($key, $value)
PhutilMarkupEngine
Set a configuration parameter which the engine can read to customize how the text is marked up. This is a generic interface; consult the documentation for specific rules and blocks for what options are available for configuration.
PhutilRemarkupEngine
Parameters
| string | $key | Key to set in the configuration dictionary. |
| string | $value | Value to set. |
Return
| this |
public function getTextMetadata($key, $default)
public function getTextMetadata($key, $default)
PhutilMarkupEngine
After text has been marked up with markupText(), you can retrieve any metadata the markup process generated by calling this method. This is a generic interface that allows rules to export extra information about text; consult the documentation for specific rules and blocks to see what metadata may be available in your configuration.
PhutilRemarkupEngine
Parameters
| string | $key | Key to retrieve from metadata. |
| mixed | $default | Default value to return if the key is not available. |
Return
| mixed | Metadata property, or default value. |
public function markupText($text)
public function markupText($text)
Parameters
| $text |
Return
| wild |
public function getConfig($key, $default)
public function getConfig($key, $default)
Parameters
| $key | ||
| $default |
Return
| wild |
public function setMode($mode)
public function setMode($mode)
Parameters
| $mode |
Return
| wild |
public function isTextMode()
public function isTextMode()
Return
| wild |
public function isAnchorMode()
public function isAnchorMode()
Return
| wild |
public function isHTMLMailMode()
public function isHTMLMailMode()
Return
| wild |
public function getQuoteDepth()
public function getQuoteDepth()
Return
| wild |
public function setQuoteDepth($depth)
public function setQuoteDepth($depth)
Parameters
| $depth |
Return
| wild |
public function setBlockRules($rules)
public function setBlockRules($rules)
Parameters
| array | $rules |
Return
| wild |
public function setTextMetadata($key, $value)
public function setTextMetadata($key, $value)
Parameters
| $key | ||
| $value |
Return
| wild |
public function storeText($text)
public function storeText($text)
Parameters
| $text |
Return
| wild |
public function overwriteStoredText($token, $new_text)
public function overwriteStoredText($token, $new_text)
Parameters
| $token | ||
| $new_text |
Return
| wild |
public function pushState($state)
public function pushState($state)
Parameters
| $state |
Return
| wild |
public function popState($state)
public function popState($state)
Parameters
| $state |
Return
| wild |
public function getState($state)
public function getState($state)
Parameters
| $state |
Return
| wild |
public function preprocessText($text)
public function preprocessText($text)
Parameters
| $text |
Return
| wild |
private function splitTextIntoBlocks($text, $depth)
private function splitTextIntoBlocks($text, $depth)
Parameters
| $text | ||
| $depth |
Return
| wild |
private function markupBlock($block)
private function markupBlock($block)
Parameters
| array | $block |
Return
| wild |
private function flattenOutput($output)
private function flattenOutput($output)
Parameters
| array | $output |
Return
| wild |
private static function shouldMergeParagraphBlocks($text, $last_block, $current_block)
private static function shouldMergeParagraphBlocks($text, $last_block, $current_block)
Parameters
| $text | ||
| $last_block | ||
| $current_block |
Return
| wild |
private static function isEmptyBlock($text, $start, $num_lines)
private static function isEmptyBlock($text, $start, $num_lines)
Parameters
| $text | ||
| $start | ||
| $num_lines |
Return
| wild |
public function postprocessText($dict)
public function postprocessText($dict)
Parameters
| array | $dict |
Return
| wild |
public function restoreText($text)
public function restoreText($text)
Parameters
| $text |
Return
| wild |