src/MarkdownIt/Ruler.php
public function enableOnly($list, $ignoreInvalid=false)
    {
        if (!is_array($list)) { $list = [ $list ]; }

        foreach ($this->__rules__ as &$rule) {
            $rule->enabled = false;
        }

        $this->enable($list, $ignoreInvalid);
    }
public function enableOnly($list, $ignoreInvalid=false)
    {
        if (!is_array($list)) { $list = [ $list ]; }

        foreach ($this->__rules__ as &$rule) {
            $rule->enabled = false;
        }

        $this->enable($list, $ignoreInvalid);
    }
public function enableOnly ( $ list , $ ignoreInvalid = false ) { if ( ! is_array ( $ list ) ) { $ list = [ $ list ] ; } foreach ( $ this -> __rules__ as & $ rule ) { $ rule -> enabled = false ; } $ this -> enable ( $ list , $ ignoreInvalid ) ; }
Enable rules with given names, and disable everything else. If any rule name
not found - throw Error. Errors can be disabled by second param.

See also [[Ruler.disable]], [[Ruler.enable]].
@param array|string $list           list of rule names to enable (whitelist).
@param bool         $ignoreInvalid  set `true` to ignore errors when $rule not found.
Enable rules with given names and disable everything else . If any rule name not found - throw Error . Errors can be disabled by second param .