Permalink
Browse files

Always sort attributes

Move attribute sorting to parseAttribsToArray() so all client functions
get a sorted list. This should unify attribute ordering with Redcloth.
  • Loading branch information...
1 parent 9e8d709 commit b64c44f78da753c7c5a5dca86b2ca6eb20f4ec35 @netcarver committed Oct 29, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/Netcarver/Textile/Parser.php
@@ -1266,7 +1266,6 @@ protected function parseAttribs($in, $element = '', $include_id = true, $autocla
{
$out = '';
$o = $this->parseAttribsToArray($in, $element, $include_id, $autoclass);
- ksort($o);
if (count($o)) {
foreach ($o as $k => $v) {
@@ -1388,6 +1387,7 @@ protected function parseAttribsToArray($in, $element = '', $include_id = true, $
$o['lang'] = $this->cleanAttribs($lang);
}
+ ksort($o);
return $o;
} else {
$class = trim($class . ' ' . $autoclass);
@@ -1445,6 +1445,7 @@ protected function parseAttribsToArray($in, $element = '', $include_id = true, $
$o['width'] = $this->cleanAttribs($width);
}
+ ksort($o);
return $o;
}

0 comments on commit b64c44f

Please sign in to comment.