public function setEngine($engine)Inherited
| PhutilRemarkupEngine | $engine |
| wild |
public function getEngine()Inherited
| wild |
public function getPriority()Inherited
| wild |
public function apply($text)Inherited
Check input whether to apply RemarkupRule. If true, apply formatting.
| string|PhutilSafeHTML | $text | String to check and potentially format. |
| string|PhutilSafeHTML | Unchanged input if no match, or input after matching the formatting rule and applying the formatting. |
public function getPostprocessKey()Inherited
| wild |
public function didMarkupText()Inherited
| 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. |
| array<string, | $attrs | mixed> $attrs Dictionary of tag attributes. |
| mixed | $content | (optional) 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.
| mixed | $text | Ostensibly flat text. |
| string | Flat text. |
protected function isFlatText($text)Inherited
Check whether text is flat (contains no replacement tokens) or not.
| mixed | $text | Ostensibly flat text. |
| bool | True if the text is flat. |
protected function getRemarkupLinkClass($is_internal)Inherited
Get the CSS class="" attribute for a Remarkup link. It's just "remarkup-link" for all cases, plus the possibility for designers to style external links differently.
| boolean | $is_internal | Whenever the link was internal or not. |
| string |
protected function getObjectNamePrefix()
| wild |
protected function loadObjects($ids)
| array | $ids |
| wild |
protected function getObjectNamePrefixBeginsWithWordCharacter()Inherited
| wild |
protected function getObjectIDPattern()Inherited
| string | Regex which defines a valid object ID |
protected function shouldMarkupObject($params)Inherited
| array | $params |
| wild |
protected function getObjectNameText($object, $handle, $id)Inherited
| $object | ||
| PhabricatorObjectHandle | $handle | |
| $id |
| wild |
protected function loadHandles($objects)Inherited
| array | $objects |
| array<PhabricatorHandleList> |
protected function getObjectHref($object, $handle, $id)Inherited
| $object | ||
| PhabricatorObjectHandle | $handle | |
| $id |
| wild |
protected function renderObjectRefForAnyMedia($object, $handle, $anchor, $id)Inherited
| $object | ||
| PhabricatorObjectHandle | $handle | |
| $anchor | ||
| $id |
| string|PhutilSafeHTML|PHUITagView |
protected function renderObjectRef($object, $handle, $anchor, $id)Inherited
| $object | ||
| PhabricatorObjectHandle | $handle | |
| $anchor | ||
| $id |
| PHUITagView |
protected function renderObjectEmbedForAnyMedia($object, $handle, $options)Inherited
| $object | ||
| PhabricatorObjectHandle | $handle | |
| $options |
| string|PhutilSafeHTML|PHUITagView |
protected function renderObjectEmbed($object, $handle, $options)Inherited
| $object | ||
| PhabricatorObjectHandle | $handle | |
| $options |
| PhutilSafeHTML|string|array |
final protected function renderDefaultObjectEmbed($object, $handle)Inherited
| $object | ||
| PhabricatorObjectHandle | $handle |
| PhutilSafeHTML|string|array |
protected function renderObjectTagForMail($text, $href, $handle)Inherited
| $text | ||
| $href | ||
| PhabricatorObjectHandle | $handle |
| PhutilSafeHTML |
protected function renderHovertag($name, $href, $attr)Inherited
| $name | ||
| $href | ||
| array | $attr |
| PhutilSafeHTML|string|array |
private function getObjectEmbedPattern()Inherited
| string | Regex |
private function getObjectReferencePattern()Inherited
| string | Regex |
public function extractReferences($text)Inherited
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. |
| map<string, RemarkupReference[]> | Matches, suitable for writing unit tests against. |
public function markupObjectEmbed($matches)Inherited
| array | $matches |
| wild |
public function markupObjectReference($matches)Inherited
| array | $matches |
| wild |
private function markupObject($params)Inherited
| array | $params |
| wild |