protected function doExtraAttributes($tag_name, $attr) { $extraAttrs = parent::doExtraAttributes($tag_name, $attr); if ('img' == $tag_name) { preg_match_all('/\\$(\\d+)x(\\d+)/', $attr, $matches); if ($matches[1] && $matches[2]) { $extraAttrs .= ' width="' . $matches[1][0] . '" height="' . $matches[2][0] . '"'; } } return $extraAttrs; }