Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Lines containing a single zero appeared blank when highlighting was d…

…isabled.
  • Loading branch information...
commit 886c7c9cf3dea2991ee1e8a19cff4f0fc8392020 1 parent 0b4f735
@aramk authored
View
5 crayon_formatter.class.php
@@ -26,7 +26,7 @@ private function __construct() {}
/* Formats the code using the parsed language elements. */
public static function format_code($code, $language, $hl = NULL) {
// Ensure the language is defined
- if ($language != NULL && $hl->is_highlighted) {
+ if ($language != NULL && $hl->is_highlighted()) {
$code = self::clean_code($code, FALSE, FALSE, FALSE, TRUE);
/* Perform the replace on the code using the regex, pass the captured matches for
formatting before they are replaced */
@@ -44,7 +44,6 @@ public static function format_code($code, $language, $hl = NULL) {
$error = 'An error occured when formatting: ' . $e->message();
$hl ? $hl->log($error) : CrayonLog::syslog($error);
}
-
return $code;
} else {
return self::clean_code($code, TRUE, TRUE, TRUE, TRUE);
@@ -169,7 +168,7 @@ public static function print_code($hl, $code, $line_numbers = TRUE, $print = TRU
$code_line = $code_lines[0][$i - 1];
// If line is blank, add a space so the div has the correct height
- if (empty($code_line)) {
+ if ($code_line == '') {
$code_line = ' ';
}
View
4 crayon_highlighter.class.php
@@ -28,7 +28,7 @@ class CrayonHighlighter {
private $is_mixed = FALSE;
// Inline code on a single floating line
private $is_inline = FALSE;
- public $is_highlighted = TRUE;
+ private $is_highlighted = TRUE;
// Objects
// Stores the CrayonLang being used
@@ -184,7 +184,7 @@ public function process() {
$this->formatted_code = CrayonFormatter::format_code($code, $this->language, $this);
} else {
// Format the code with Mixed Highlighting
- $this->formatted_code = CrayonFormatter::format_mixed_code($code, $this->language, $this);
+ $this->formatted_code = CrayonFormatter::format_mixed_code($code, $this->language, $this);
}
} catch (Exception $e) {
$this->error($e->message());
View
1  readme.txt
@@ -251,6 +251,7 @@ Contact me at http://twitter.com/crayonsyntax or crayon.syntax@gmail.com.
* All language css classes are prefixed with "crayon-" to prevent conflicts
* Terminal theme fix
* Improved language readme
+ * Lines containing a single zero appeared blank when highlighting was disabled
= 2.2.0 =
* ADDED:
Please sign in to comment.
Something went wrong with that request. Please try again.