public function __get($name)Inherited
$name |
wild |
public function __set($name, $value)Inherited
$name | ||
$value |
wild |
public function current()Inherited
wild |
public function key()Inherited
wild |
public function next()Inherited
wild |
public function rewind()Inherited
wild |
public function valid()Inherited
wild |
private function throwOnAttemptedIteration()Inherited
wild |
public function getPhobjectClassConstant($key, $byte_limit)Inherited
Read the value of a class constant.
This is the same as just typing self::CONSTANTNAME, but throws a more useful message if the constant is not defined and allows the constant to be limited to a maximum length.
string | $key | Name of the constant. |
int|null | $byte_limit | Maximum number of bytes permitted in the value. |
string | Value of the constant. |
public function setEngine($engine)
PhutilRemarkupEngine | $engine |
wild |
public function getEngine()
wild |
public function getPriority()
wild |
abstract public function apply($text)
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()
wild |
public function didMarkupText()
wild |
protected function replaceHTML($pattern, $callback, $text)
$pattern | ||
$callback | ||
$text |
wild |
private function replaceHTMLCallback($match)
array | $match |
wild |
protected function newTag($name, $attrs, $content)
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)
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)
Check whether text is flat (contains no replacement tokens) or not.
wild | $text | Ostensibly flat text. |
bool | True if the text is flat. |