예제 #1
0
 /**
  * Extracts tag attributes from a markup string.
  *
  * @param string $markup
  */
 protected function extractAttributes($markup)
 {
     $this->attributes = array();
     $attributeRegexp = new Regexp(Liquid::get('TAG_ATTRIBUTES'));
     $matches = $attributeRegexp->scan($markup);
     foreach ($matches as $match) {
         $this->attributes[$match[0]] = $match[1];
     }
 }
예제 #2
0
 public function testQuotedWordsInTheMiddle()
 {
     $this->assertEquals(array('arg1', 'arg2', '"arg 3"', 'arg4'), $this->regexp->scan('arg1 arg2 "arg 3" arg4   '));
 }