Skip to content

Commit

Permalink
Remove unused codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Asif Iqbal committed May 28, 2016
1 parent 6d20e6e commit 2968556
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/Compilers/ShortcodeCompiler.php
Expand Up @@ -243,7 +243,7 @@ protected function parseAttributes($text)
// attributes pattern
$pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/';
// Match
if (preg_match_all($pattern, preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text), $match, PREG_SET_ORDER)) {
if (preg_match_all($pattern, preg_replace('/[\x{00a0}\x{200b}]+/u', " ", $text), $match, PREG_SET_ORDER)) {
foreach ($match as $m) {
if (!empty($m[1])) {
$attributes[strtolower($m[1])] = stripcslashes($m[2]);
Expand Down Expand Up @@ -283,21 +283,11 @@ protected function getShortcodeNames()
*/
protected function getRegex()
{
// Get shortcode names
$shortcodeNames = $this->getShortcodeNames();

// return regex
return "\\[(\\[?)($shortcodeNames)(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*+(?:\\[(?!\\/\\2\\])[^\\[]*+)*+)\\[\\/\\2\\])?)(\\]?)";
}

/*private function getStripRegex()
{
// Get shortcode names
$shortcodeNames = $this->getShortcodeNames();
return
'\\[(\\[?)('.$shortcodeNames.')(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*+(?:\\[(?!\\/\\2\\])[^\\[]*+)*+)\\[\\/\\2\\])?)(\\]?)';
}*/
/**
* Remove all shortcode tags from the given content.
*
Expand Down

0 comments on commit 2968556

Please sign in to comment.