public function setEngine($engine)Inherited
PhutilRemarkupEngine | $engine |
wild |
public function getEngine()Inherited
wild |
public function getPriority()
wild |
public function apply($text)
$text |
wild |
public function getPostprocessKey()Inherited
wild |
public function didMarkupText()
wild |
protected function replaceHTML($pattern, $callback, $text)Inherited
$pattern | ||
$callback | ||
$text |
wild |
private function replaceHTMLCallback($match)Inherited
array | $match |
wild |
protected function newTag($name, $attrs, $content)Inherited
Safely generate a tag.
In Remarkup contexts, it's not safe to use arbitrary text in tag attributes: even though it will be escaped, it may contain replacement tokens which are then replaced with markup.
This method acts as phutil_tag(), but checks attributes before using them.
string | $name | Tag name. |
dict<string, | $attrs | wild> Tag attributes. |
wild | $content | Tag content. |
PhutilSafeHTML | Tag object. |
protected function assertFlatText($text)Inherited
Assert that a text token is flat (it contains no replacement tokens).
Because tokens can be replaced with markup, it is dangerous to use arbitrary input text in tag attributes. Normally, rule precedence should prevent this. Asserting that text is flat before using it as an attribute provides an extra layer of security.
Normally, you can call newTag() rather than calling this method directly. newTag() will check attributes for you.
wild | $text | Ostensibly flat text. |
string | Flat text. |
protected function isFlatText($text)Inherited
Check whether text is flat (contains no replacement tokens) or not.
wild | $text | Ostensibly flat text. |
bool | True if the text is flat. |
abstract protected function getObjectNamePrefix()
wild |
abstract protected function loadObjects($ids)
array | $ids |
wild |
protected function getObjectNamePrefixBeginsWithWordCharacter()
wild |
protected function getObjectIDPattern()
wild |
protected function shouldMarkupObject($params)
array | $params |
wild |
protected function getObjectNameText($object, $handle, $id)
$object | ||
PhabricatorObjectHandle | $handle | |
$id |
wild |
protected function loadHandles($objects)
array | $objects |
wild |
protected function getObjectHref($object, $handle, $id)
$object | ||
PhabricatorObjectHandle | $handle | |
$id |
wild |
protected function renderObjectRefForAnyMedia($object, $handle, $anchor, $id)
$object | ||
PhabricatorObjectHandle | $handle | |
$anchor | ||
$id |
wild |
protected function renderObjectRef($object, $handle, $anchor, $id)
$object | ||
PhabricatorObjectHandle | $handle | |
$anchor | ||
$id |
wild |
protected function renderObjectEmbedForAnyMedia($object, $handle, $options)
$object | ||
PhabricatorObjectHandle | $handle | |
$options |
wild |
protected function renderObjectEmbed($object, $handle, $options)
$object | ||
PhabricatorObjectHandle | $handle | |
$options |
wild |
protected function renderObjectTagForMail($text, $href, $handle)
$text | ||
$href | ||
PhabricatorObjectHandle | $handle |
wild |
protected function renderHovertag($name, $href, $attr)
$name | ||
$href | ||
array | $attr |
wild |
private function getObjectEmbedPattern()
wild |
private function getObjectReferencePattern()
wild |
public function extractReferences($text)
Extract matched object references from a block of text.
This is intended to make it easy to write unit tests for object remarkup rules. Production code is not normally expected to call this method.
string | $text | Text to match rules against. |
wild | Matches, suitable for writing unit tests against. |
public function markupObjectEmbed($matches)
array | $matches |
wild |
public function markupObjectReference($matches)
array | $matches |
wild |
private function markupObject($params)
array | $params |
wild |