Exemplo n.º 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];
     }
 }
Exemplo n.º 2
0
 public function testQuotedWordsInTheMiddle()
 {
     $this->assertEquals(array('arg1', 'arg2', '"arg 3"', 'arg4'), $this->regexp->scan('arg1 arg2 "arg 3" arg4   '));
 }