Beispiel #1
0
 /**
  * Extracts tag attributes from a markup string
  *
  * @param string $markup
  */
 public function extract_attributes($markup)
 {
     $this->attributes = array();
     $attribute_regexp = new LiquidRegexp(LIQUID_TAG_ATTRIBUTES);
     $matches = $attribute_regexp->scan($markup);
     foreach ($matches as $match) {
         $this->attributes[$match[0]] = $match[1];
     }
 }
Beispiel #2
0
 function test_quoted_words_in_the_middle()
 {
     $this->assertEqual(array('arg1', 'arg2', '"arg 3"', 'arg4'), $this->regexp->scan('arg1 arg2 "arg 3" arg4   '));
 }