@@ -16,7 +16,8 @@ discard block |
||
| 16 | 16 | <div id='wrapper'> |
| 17 | 17 | |
| 18 | 18 | <div id='header'> |
| 19 | -<?php if(isset($header)) echo $header?> |
|
| 19 | +<?php if(isset($header)) { |
|
| 20 | + echo $header?> |
|
| 20 | 21 | <?php $this->views->render('header')?> |
| 21 | 22 | </div> |
| 22 | 23 | |
@@ -24,10 +25,13 @@ discard block |
||
| 24 | 25 | <div id='navbar'> |
| 25 | 26 | <?php $this->views->render('navbar')?> |
| 26 | 27 | </div> |
| 27 | -<?php endif; ?> |
|
| 28 | +<?php endif; |
|
| 29 | +} |
|
| 30 | +?> |
|
| 28 | 31 | |
| 29 | 32 | <div id='main'> |
| 30 | -<?php if(isset($main)) echo $main?> |
|
| 33 | +<?php if(isset($main)) { |
|
| 34 | + echo $main?> |
|
| 31 | 35 | <?php $this->views->render('main')?> |
| 32 | 36 | </div> |
| 33 | 37 | |
@@ -38,7 +42,9 @@ discard block |
||
| 38 | 42 | |
| 39 | 43 | </div> |
| 40 | 44 | |
| 41 | -<?php if(isset($jquery)):?><script src='<?=$this->url->asset($jquery)?>'></script><?php endif; ?> |
|
| 45 | +<?php if(isset($jquery)):?><script src='<?=$this->url->asset($jquery)?>'></script><?php endif; |
|
| 46 | +} |
|
| 47 | +?> |
|
| 42 | 48 | |
| 43 | 49 | <?php if(isset($javascript_include)): foreach($javascript_include as $val): ?> |
| 44 | 50 | <script src='<?=$this->url->asset($val)?>'></script> |
@@ -38,8 +38,9 @@ discard block |
||
| 38 | 38 | $parser =& $parser_list[$parser_class]; |
| 39 | 39 | |
| 40 | 40 | # create the parser it not already set |
| 41 | - if (!$parser) |
|
| 42 | - $parser = new $parser_class; |
|
| 41 | + if (!$parser) { |
|
| 42 | + $parser = new $parser_class; |
|
| 43 | + } |
|
| 43 | 44 | |
| 44 | 45 | # Transform text using parser. |
| 45 | 46 | return $parser->transform($text); |
@@ -223,7 +224,9 @@ discard block |
||
| 223 | 224 | |
| 224 | 225 | |
| 225 | 226 | protected function hashHTMLBlocks($text) { |
| 226 | - if ($this->no_markup) return $text; |
|
| 227 | + if ($this->no_markup) { |
|
| 228 | + return $text; |
|
| 229 | + } |
|
| 227 | 230 | |
| 228 | 231 | $less_than_tab = $this->tab_width - 1; |
| 229 | 232 | |
@@ -511,7 +514,9 @@ discard block |
||
| 511 | 514 | # |
| 512 | 515 | # Turn Markdown link shortcuts into XHTML <a> tags. |
| 513 | 516 | # |
| 514 | - if ($this->in_anchor) return $text; |
|
| 517 | + if ($this->in_anchor) { |
|
| 518 | + return $text; |
|
| 519 | + } |
|
| 515 | 520 | $this->in_anchor = true; |
| 516 | 521 | |
| 517 | 522 | # |
@@ -605,8 +610,7 @@ discard block |
||
| 605 | 610 | $link_text = $this->runSpanGamut($link_text); |
| 606 | 611 | $result .= ">$link_text</a>"; |
| 607 | 612 | $result = $this->hashPart($result); |
| 608 | - } |
|
| 609 | - else { |
|
| 613 | + } else { |
|
| 610 | 614 | $result = $whole_match; |
| 611 | 615 | } |
| 612 | 616 | return $result; |
@@ -707,8 +711,7 @@ discard block |
||
| 707 | 711 | } |
| 708 | 712 | $result .= $this->empty_element_suffix; |
| 709 | 713 | $result = $this->hashPart($result); |
| 710 | - } |
|
| 711 | - else { |
|
| 714 | + } else { |
|
| 712 | 715 | # If there's no such link ID, leave intact: |
| 713 | 716 | $result = $whole_match; |
| 714 | 717 | } |
@@ -766,8 +769,9 @@ discard block |
||
| 766 | 769 | } |
| 767 | 770 | protected function _doHeaders_callback_setext($matches) { |
| 768 | 771 | # Terrible hack to check we haven't found an empty list item. |
| 769 | - if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1])) |
|
| 770 | - return $matches[0]; |
|
| 772 | + if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1])) { |
|
| 773 | + return $matches[0]; |
|
| 774 | + } |
|
| 771 | 775 | |
| 772 | 776 | $level = $matches[2]{0} == '=' ? 1 : 2; |
| 773 | 777 | $block = "<h$level>".$this->runSpanGamut($matches[1])."</h$level>"; |
@@ -834,8 +838,7 @@ discard block |
||
| 834 | 838 | '.$whole_list_re.' |
| 835 | 839 | }mx', |
| 836 | 840 | array(&$this, '_doLists_callback'), $text); |
| 837 | - } |
|
| 838 | - else { |
|
| 841 | + } else { |
|
| 839 | 842 | $text = preg_replace_callback('{ |
| 840 | 843 | (?:(?<=\n)\n|\A\n?) # Must eat the newline |
| 841 | 844 | '.$whole_list_re.' |
@@ -925,8 +928,7 @@ discard block |
||
| 925 | 928 | # Replace marker with the appropriate whitespace indentation |
| 926 | 929 | $item = $leading_space . str_repeat(' ', strlen($marker_space)) . $item; |
| 927 | 930 | $item = $this->runBlockGamut($this->outdent($item)."\n"); |
| 928 | - } |
|
| 929 | - else { |
|
| 931 | + } else { |
|
| 930 | 932 | # Recursion for sub-lists: |
| 931 | 933 | $item = $this->doLists($this->outdent($item)); |
| 932 | 934 | $item = preg_replace('/\n+$/', '', $item); |
@@ -1196,8 +1198,7 @@ discard block |
||
| 1196 | 1198 | $value = preg_replace('/^([ ]*)/', "<p>", $value); |
| 1197 | 1199 | $value .= "</p>"; |
| 1198 | 1200 | $grafs[$key] = $this->unhash($value); |
| 1199 | - } |
|
| 1200 | - else { |
|
| 1201 | + } else { |
|
| 1201 | 1202 | # Is a block. |
| 1202 | 1203 | # Modify elements of @grafs in-place... |
| 1203 | 1204 | $graf = $value; |
@@ -1352,8 +1353,11 @@ discard block |
||
| 1352 | 1353 | # roughly 10% raw, 45% hex, 45% dec |
| 1353 | 1354 | # '@' *must* be encoded. I insist. |
| 1354 | 1355 | if ($r > 90 && $char != '@') /* do nothing */; |
| 1355 | - else if ($r < 45) $chars[$key] = '&#x'.dechex($ord).';'; |
|
| 1356 | - else $chars[$key] = '&#'.$ord.';'; |
|
| 1356 | + else if ($r < 45) { |
|
| 1357 | + $chars[$key] = '&#x'.dechex($ord).';'; |
|
| 1358 | + } else { |
|
| 1359 | + $chars[$key] = '&#'.$ord.';'; |
|
| 1360 | + } |
|
| 1357 | 1361 | } |
| 1358 | 1362 | } |
| 1359 | 1363 | |
@@ -1415,8 +1419,7 @@ discard block |
||
| 1415 | 1419 | if (isset($parts[1])) { |
| 1416 | 1420 | $output .= $this->handleSpanToken($parts[1], $parts[2]); |
| 1417 | 1421 | $str = $parts[2]; |
| 1418 | - } |
|
| 1419 | - else { |
|
| 1422 | + } else { |
|
| 1420 | 1423 | break; |
| 1421 | 1424 | } |
| 1422 | 1425 | } |
@@ -1498,7 +1501,9 @@ discard block |
||
| 1498 | 1501 | # function that will loosely count the number of UTF-8 characters with a |
| 1499 | 1502 | # regular expression. |
| 1500 | 1503 | # |
| 1501 | - if (function_exists($this->utf8_strlen)) return; |
|
| 1504 | + if (function_exists($this->utf8_strlen)) { |
|
| 1505 | + return; |
|
| 1506 | + } |
|
| 1502 | 1507 | $this->utf8_strlen = create_function('$text', 'return preg_match_all( |
| 1503 | 1508 | "/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/", |
| 1504 | 1509 | $text, $m);'); |
@@ -1620,8 +1625,9 @@ discard block |
||
| 1620 | 1625 | $this->footnote_counter = 1; |
| 1621 | 1626 | |
| 1622 | 1627 | foreach ($this->predef_abbr as $abbr_word => $abbr_desc) { |
| 1623 | - if ($this->abbr_word_re) |
|
| 1624 | - $this->abbr_word_re .= '|'; |
|
| 1628 | + if ($this->abbr_word_re) { |
|
| 1629 | + $this->abbr_word_re .= '|'; |
|
| 1630 | + } |
|
| 1625 | 1631 | $this->abbr_word_re .= preg_quote($abbr_word); |
| 1626 | 1632 | $this->abbr_desciptions[$abbr_word] = trim($abbr_desc); |
| 1627 | 1633 | } |
@@ -1656,7 +1662,9 @@ discard block |
||
| 1656 | 1662 | # |
| 1657 | 1663 | # Currently supported attributes are .class and #id. |
| 1658 | 1664 | # |
| 1659 | - if (empty($attr)) return ""; |
|
| 1665 | + if (empty($attr)) { |
|
| 1666 | + return ""; |
|
| 1667 | + } |
|
| 1660 | 1668 | |
| 1661 | 1669 | # Split on components |
| 1662 | 1670 | preg_match_all('/[#.][-_:a-zA-Z0-9]+/', $attr, $matches); |
@@ -1669,7 +1677,9 @@ discard block |
||
| 1669 | 1677 | if ($element{0} == '.') { |
| 1670 | 1678 | $classes[] = substr($element, 1); |
| 1671 | 1679 | } else if ($element{0} == '#') { |
| 1672 | - if ($id === false) $id = substr($element, 1); |
|
| 1680 | + if ($id === false) { |
|
| 1681 | + $id = substr($element, 1); |
|
| 1682 | + } |
|
| 1673 | 1683 | } |
| 1674 | 1684 | } |
| 1675 | 1685 | |
@@ -1765,7 +1775,9 @@ discard block |
||
| 1765 | 1775 | # _HashHTMLBlocks_InMarkdown to handle the Markdown syntax within the tag. |
| 1766 | 1776 | # These two functions are calling each other. It's recursive! |
| 1767 | 1777 | # |
| 1768 | - if ($this->no_markup) return $text; |
|
| 1778 | + if ($this->no_markup) { |
|
| 1779 | + return $text; |
|
| 1780 | + } |
|
| 1769 | 1781 | |
| 1770 | 1782 | # |
| 1771 | 1783 | # Call the HTML-in-Markdown hasher. |
@@ -1802,7 +1814,9 @@ discard block |
||
| 1802 | 1814 | # |
| 1803 | 1815 | # Returns an array of that form: ( processed text , remaining text ) |
| 1804 | 1816 | # |
| 1805 | - if ($text === '') return array('', ''); |
|
| 1817 | + if ($text === '') { |
|
| 1818 | + return array('', ''); |
|
| 1819 | + } |
|
| 1806 | 1820 | |
| 1807 | 1821 | # Regex to check for the presense of newlines around a block tag. |
| 1808 | 1822 | $newline_before_re = '/(?:^\n?|\n\n)*$/'; |
@@ -1922,8 +1936,7 @@ discard block |
||
| 1922 | 1936 | # End marker found: pass text unchanged until marker. |
| 1923 | 1937 | $parsed .= $tag . $matches[0]; |
| 1924 | 1938 | $text = substr($text, strlen($matches[0])); |
| 1925 | - } |
|
| 1926 | - else { |
|
| 1939 | + } else { |
|
| 1927 | 1940 | # No end marker: just skip it. |
| 1928 | 1941 | $parsed .= $tag; |
| 1929 | 1942 | } |
@@ -1949,8 +1962,7 @@ discard block |
||
| 1949 | 1962 | # End marker found: pass text unchanged until marker. |
| 1950 | 1963 | $parsed .= $tag . $matches[0]; |
| 1951 | 1964 | $text = substr($text, strlen($matches[0])); |
| 1952 | - } |
|
| 1953 | - else { |
|
| 1965 | + } else { |
|
| 1954 | 1966 | # Unmatched marker: just skip it. |
| 1955 | 1967 | $parsed .= $tag; |
| 1956 | 1968 | } |
@@ -1997,8 +2009,11 @@ discard block |
||
| 1997 | 2009 | # |
| 1998 | 2010 | # Increase/decrease nested tag count. |
| 1999 | 2011 | # |
| 2000 | - if ($tag{1} == '/') $depth--; |
|
| 2001 | - else if ($tag{strlen($tag)-2} != '/') $depth++; |
|
| 2012 | + if ($tag{1} == '/') { |
|
| 2013 | + $depth--; |
|
| 2014 | + } else if ($tag{strlen($tag)-2} != '/') { |
|
| 2015 | + $depth++; |
|
| 2016 | + } |
|
| 2002 | 2017 | |
| 2003 | 2018 | if ($depth < 0) { |
| 2004 | 2019 | # |
@@ -2010,8 +2025,7 @@ discard block |
||
| 2010 | 2025 | } |
| 2011 | 2026 | |
| 2012 | 2027 | $parsed .= $tag; |
| 2013 | - } |
|
| 2014 | - else { |
|
| 2028 | + } else { |
|
| 2015 | 2029 | $parsed .= $tag; |
| 2016 | 2030 | } |
| 2017 | 2031 | } while ($depth >= 0); |
@@ -2029,7 +2043,9 @@ discard block |
||
| 2029 | 2043 | # |
| 2030 | 2044 | # Returns an array of that form: ( processed text , remaining text ) |
| 2031 | 2045 | # |
| 2032 | - if ($text === '') return array('', ''); |
|
| 2046 | + if ($text === '') { |
|
| 2047 | + return array('', ''); |
|
| 2048 | + } |
|
| 2033 | 2049 | |
| 2034 | 2050 | # Regex to match `markdown` attribute inside of a tag. |
| 2035 | 2051 | $markdown_attr_re = ' |
@@ -2080,8 +2096,9 @@ discard block |
||
| 2080 | 2096 | # Get the name of the starting tag. |
| 2081 | 2097 | # (This pattern makes $base_tag_name_re safe without quoting.) |
| 2082 | 2098 | # |
| 2083 | - if (preg_match('/^<([\w:$]*)\b/', $text, $matches)) |
|
| 2084 | - $base_tag_name_re = $matches[1]; |
|
| 2099 | + if (preg_match('/^<([\w:$]*)\b/', $text, $matches)) { |
|
| 2100 | + $base_tag_name_re = $matches[1]; |
|
| 2101 | + } |
|
| 2085 | 2102 | |
| 2086 | 2103 | # |
| 2087 | 2104 | # Loop through every tag until we find the corresponding closing tag. |
@@ -2118,15 +2135,17 @@ discard block |
||
| 2118 | 2135 | { |
| 2119 | 2136 | # Just add the tag to the block as if it was text. |
| 2120 | 2137 | $block_text .= $tag; |
| 2121 | - } |
|
| 2122 | - else { |
|
| 2138 | + } else { |
|
| 2123 | 2139 | # |
| 2124 | 2140 | # Increase/decrease nested tag count. Only do so if |
| 2125 | 2141 | # the tag's name match base tag's. |
| 2126 | 2142 | # |
| 2127 | 2143 | if (preg_match('{^</?'.$base_tag_name_re.'\b}', $tag)) { |
| 2128 | - if ($tag{1} == '/') $depth--; |
|
| 2129 | - else if ($tag{strlen($tag)-2} != '/') $depth++; |
|
| 2144 | + if ($tag{1} == '/') { |
|
| 2145 | + $depth--; |
|
| 2146 | + } else if ($tag{strlen($tag)-2} != '/') { |
|
| 2147 | + $depth++; |
|
| 2148 | + } |
|
| 2130 | 2149 | } |
| 2131 | 2150 | |
| 2132 | 2151 | # |
@@ -2173,13 +2192,17 @@ discard block |
||
| 2173 | 2192 | } |
| 2174 | 2193 | |
| 2175 | 2194 | # Append tag content to parsed text. |
| 2176 | - if (!$span_mode) $parsed .= "\n\n$block_text\n\n"; |
|
| 2177 | - else $parsed .= "$block_text"; |
|
| 2195 | + if (!$span_mode) { |
|
| 2196 | + $parsed .= "\n\n$block_text\n\n"; |
|
| 2197 | + } else { |
|
| 2198 | + $parsed .= "$block_text"; |
|
| 2199 | + } |
|
| 2178 | 2200 | |
| 2179 | 2201 | # Start over with a new block. |
| 2180 | 2202 | $block_text = ""; |
| 2203 | + } else { |
|
| 2204 | + $block_text .= $tag; |
|
| 2181 | 2205 | } |
| 2182 | - else $block_text .= $tag; |
|
| 2183 | 2206 | } |
| 2184 | 2207 | |
| 2185 | 2208 | } while ($depth > 0); |
@@ -2207,7 +2230,9 @@ discard block |
||
| 2207 | 2230 | # |
| 2208 | 2231 | # Turn Markdown link shortcuts into XHTML <a> tags. |
| 2209 | 2232 | # |
| 2210 | - if ($this->in_anchor) return $text; |
|
| 2233 | + if ($this->in_anchor) { |
|
| 2234 | + return $text; |
|
| 2235 | + } |
|
| 2211 | 2236 | $this->in_anchor = true; |
| 2212 | 2237 | |
| 2213 | 2238 | # |
@@ -2298,14 +2323,14 @@ discard block |
||
| 2298 | 2323 | $title = $this->encodeAttribute($title); |
| 2299 | 2324 | $result .= " title=\"$title\""; |
| 2300 | 2325 | } |
| 2301 | - if (isset($this->ref_attr[$link_id])) |
|
| 2302 | - $result .= $this->ref_attr[$link_id]; |
|
| 2326 | + if (isset($this->ref_attr[$link_id])) { |
|
| 2327 | + $result .= $this->ref_attr[$link_id]; |
|
| 2328 | + } |
|
| 2303 | 2329 | |
| 2304 | 2330 | $link_text = $this->runSpanGamut($link_text); |
| 2305 | 2331 | $result .= ">$link_text</a>"; |
| 2306 | 2332 | $result = $this->hashPart($result); |
| 2307 | - } |
|
| 2308 | - else { |
|
| 2333 | + } else { |
|
| 2309 | 2334 | $result = $whole_match; |
| 2310 | 2335 | } |
| 2311 | 2336 | return $result; |
@@ -2408,12 +2433,12 @@ discard block |
||
| 2408 | 2433 | $title = $this->encodeAttribute($title); |
| 2409 | 2434 | $result .= " title=\"$title\""; |
| 2410 | 2435 | } |
| 2411 | - if (isset($this->ref_attr[$link_id])) |
|
| 2412 | - $result .= $this->ref_attr[$link_id]; |
|
| 2436 | + if (isset($this->ref_attr[$link_id])) { |
|
| 2437 | + $result .= $this->ref_attr[$link_id]; |
|
| 2438 | + } |
|
| 2413 | 2439 | $result .= $this->empty_element_suffix; |
| 2414 | 2440 | $result = $this->hashPart($result); |
| 2415 | - } |
|
| 2416 | - else { |
|
| 2441 | + } else { |
|
| 2417 | 2442 | # If there's no such link ID, leave intact: |
| 2418 | 2443 | $result = $whole_match; |
| 2419 | 2444 | } |
@@ -2482,8 +2507,9 @@ discard block |
||
| 2482 | 2507 | return $text; |
| 2483 | 2508 | } |
| 2484 | 2509 | protected function _doHeaders_callback_setext($matches) { |
| 2485 | - if ($matches[3] == '-' && preg_match('{^- }', $matches[1])) |
|
| 2486 | - return $matches[0]; |
|
| 2510 | + if ($matches[3] == '-' && preg_match('{^- }', $matches[1])) { |
|
| 2511 | + return $matches[0]; |
|
| 2512 | + } |
|
| 2487 | 2513 | $level = $matches[3]{0} == '=' ? 1 : 2; |
| 2488 | 2514 | $attr = $this->doExtraAttributes("h$level", $dummy =& $matches[2]); |
| 2489 | 2515 | $block = "<h$level$attr>".$this->runSpanGamut($matches[1])."</h$level>"; |
@@ -2570,8 +2596,9 @@ discard block |
||
| 2570 | 2596 | } |
| 2571 | 2597 | protected function _doTable_makeAlignAttr($alignname) |
| 2572 | 2598 | { |
| 2573 | - if (empty($this->table_align_class_tmpl)) |
|
| 2574 | - return " align=\"$alignname\""; |
|
| 2599 | + if (empty($this->table_align_class_tmpl)) { |
|
| 2600 | + return " align=\"$alignname\""; |
|
| 2601 | + } |
|
| 2575 | 2602 | |
| 2576 | 2603 | $classname = str_replace('%%', $alignname, $this->table_align_class_tmpl); |
| 2577 | 2604 | return " class=\"$classname\""; |
@@ -2589,14 +2616,15 @@ discard block |
||
| 2589 | 2616 | # Reading alignement from header underline. |
| 2590 | 2617 | $separators = preg_split('/ *[|] */', $underline); |
| 2591 | 2618 | foreach ($separators as $n => $s) { |
| 2592 | - if (preg_match('/^ *-+: *$/', $s)) |
|
| 2593 | - $attr[$n] = $this->_doTable_makeAlignAttr('right'); |
|
| 2594 | - else if (preg_match('/^ *:-+: *$/', $s)) |
|
| 2595 | - $attr[$n] = $this->_doTable_makeAlignAttr('center'); |
|
| 2596 | - else if (preg_match('/^ *:-+ *$/', $s)) |
|
| 2597 | - $attr[$n] = $this->_doTable_makeAlignAttr('left'); |
|
| 2598 | - else |
|
| 2599 | - $attr[$n] = ''; |
|
| 2619 | + if (preg_match('/^ *-+: *$/', $s)) { |
|
| 2620 | + $attr[$n] = $this->_doTable_makeAlignAttr('right'); |
|
| 2621 | + } else if (preg_match('/^ *:-+: *$/', $s)) { |
|
| 2622 | + $attr[$n] = $this->_doTable_makeAlignAttr('center'); |
|
| 2623 | + } else if (preg_match('/^ *:-+ *$/', $s)) { |
|
| 2624 | + $attr[$n] = $this->_doTable_makeAlignAttr('left'); |
|
| 2625 | + } else { |
|
| 2626 | + $attr[$n] = ''; |
|
| 2627 | + } |
|
| 2600 | 2628 | } |
| 2601 | 2629 | |
| 2602 | 2630 | # Parsing span elements, including code spans, character escapes, |
@@ -2610,8 +2638,9 @@ discard block |
||
| 2610 | 2638 | $text = "<table>\n"; |
| 2611 | 2639 | $text .= "<thead>\n"; |
| 2612 | 2640 | $text .= "<tr>\n"; |
| 2613 | - foreach ($headers as $n => $header) |
|
| 2614 | - $text .= " <th$attr[$n]>".$this->runSpanGamut(trim($header))."</th>\n"; |
|
| 2641 | + foreach ($headers as $n => $header) { |
|
| 2642 | + $text .= " <th$attr[$n]>".$this->runSpanGamut(trim($header))."</th>\n"; |
|
| 2643 | + } |
|
| 2615 | 2644 | $text .= "</tr>\n"; |
| 2616 | 2645 | $text .= "</thead>\n"; |
| 2617 | 2646 | |
@@ -2629,8 +2658,9 @@ discard block |
||
| 2629 | 2658 | $row_cells = array_pad($row_cells, $col_count, ''); |
| 2630 | 2659 | |
| 2631 | 2660 | $text .= "<tr>\n"; |
| 2632 | - foreach ($row_cells as $n => $cell) |
|
| 2633 | - $text .= " <td$attr[$n]>".$this->runSpanGamut(trim($cell))."</td>\n"; |
|
| 2661 | + foreach ($row_cells as $n => $cell) { |
|
| 2662 | + $text .= " <td$attr[$n]>".$this->runSpanGamut(trim($cell))."</td>\n"; |
|
| 2663 | + } |
|
| 2634 | 2664 | $text .= "</tr>\n"; |
| 2635 | 2665 | } |
| 2636 | 2666 | $text .= "</tbody>\n"; |
@@ -2756,8 +2786,7 @@ discard block |
||
| 2756 | 2786 | $def = str_repeat(' ', strlen($marker_space)) . $def; |
| 2757 | 2787 | $def = $this->runBlockGamut($this->outdent($def . "\n\n")); |
| 2758 | 2788 | $def = "\n". $def ."\n"; |
| 2759 | - } |
|
| 2760 | - else { |
|
| 2789 | + } else { |
|
| 2761 | 2790 | $def = rtrim($def); |
| 2762 | 2791 | $def = $this->runSpanGamut($this->outdent($def)); |
| 2763 | 2792 | } |
@@ -2814,8 +2843,9 @@ discard block |
||
| 2814 | 2843 | array(&$this, '_doFencedCodeBlocks_newlines'), $codeblock); |
| 2815 | 2844 | |
| 2816 | 2845 | if ($classname != "") { |
| 2817 | - if ($classname{0} == '.') |
|
| 2818 | - $classname = substr($classname, 1); |
|
| 2846 | + if ($classname{0} == '.') { |
|
| 2847 | + $classname = substr($classname, 1); |
|
| 2848 | + } |
|
| 2819 | 2849 | $attr_str = ' class="'.$this->code_class_prefix.$classname.'"'; |
| 2820 | 2850 | } else { |
| 2821 | 2851 | $attr_str = $this->doExtraAttributes($this->code_attr_on_pre ? "pre" : "code", $attrs); |
@@ -3064,8 +3094,9 @@ discard block |
||
| 3064 | 3094 | protected function _stripAbbreviations_callback($matches) { |
| 3065 | 3095 | $abbr_word = $matches[1]; |
| 3066 | 3096 | $abbr_desc = $matches[2]; |
| 3067 | - if ($this->abbr_word_re) |
|
| 3068 | - $this->abbr_word_re .= '|'; |
|
| 3097 | + if ($this->abbr_word_re) { |
|
| 3098 | + $this->abbr_word_re .= '|'; |
|
| 3099 | + } |
|
| 3069 | 3100 | $this->abbr_word_re .= preg_quote($abbr_word); |
| 3070 | 3101 | $this->abbr_desciptions[$abbr_word] = trim($abbr_desc); |
| 3071 | 3102 | return ''; # String that will replace the block |
@@ -28,11 +28,9 @@ |
||
| 28 | 28 | { |
| 29 | 29 | if (is_array($what)) { |
| 30 | 30 | $options = $what; |
| 31 | - } |
|
| 32 | - elseif (is_readable($what)) { |
|
| 31 | + } elseif (is_readable($what)) { |
|
| 33 | 32 | $options = include $what; |
| 34 | - } |
|
| 35 | - else { |
|
| 33 | + } else { |
|
| 36 | 34 | throw new Exception("Configure item '" . htmlentities($what) |
| 37 | 35 | . "' is not an array nor a readable file."); |
| 38 | 36 | } |
@@ -33,7 +33,9 @@ discard block |
||
| 33 | 33 | function mergesort(&$array, $cmp_function) |
| 34 | 34 | { |
| 35 | 35 | // Arrays of size < 2 require no action. |
| 36 | - if (count($array) < 2) return; |
|
| 36 | + if (count($array) < 2) { |
|
| 37 | + return; |
|
| 38 | + } |
|
| 37 | 39 | // Split the array in half |
| 38 | 40 | $halfway = count($array) / 2; |
| 39 | 41 | $array1 = array_slice($array, 0, $halfway); |
@@ -57,7 +59,11 @@ discard block |
||
| 57 | 59 | } |
| 58 | 60 | } |
| 59 | 61 | // Merge the remainder |
| 60 | - while ($ptr1 < count($array1)) $array[] = $array1[$ptr1++]; |
|
| 61 | - while ($ptr2 < count($array2)) $array[] = $array2[$ptr2++]; |
|
| 62 | + while ($ptr1 < count($array1)) { |
|
| 63 | + $array[] = $array1[$ptr1++]; |
|
| 64 | + } |
|
| 65 | + while ($ptr2 < count($array2)) { |
|
| 66 | + $array[] = $array2[$ptr2++]; |
|
| 67 | + } |
|
| 62 | 68 | return; |
| 63 | 69 | } |