Skip to content

Commit

Permalink
Always add a CSS class for obfuscated
Browse files Browse the repository at this point in the history
This makes it possible to style obfuscated without having to use CSS classes for all color/format codes.
  • Loading branch information
Spirit55555 committed Jun 22, 2020
1 parent c52a356 commit 9b6fb6e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/MinecraftColors.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,12 @@ static public function convertToHTML($text, $line_break_element = false, $css_cl
$open_tags++;
}

else if ($color_code === 'k')
$html = '';
//Special case for obfuscated, always add a CSS class for this.
else if ($color_code === 'k') {
$css_classname = $css_prefix.self::$css_classnames[$color_code];
$html .= sprintf(self::START_TAG_WITH_CLASS, $css_classname);
$open_tags++;
}

else if (!$is_reset) {
$html .= sprintf(self::START_TAG_INLINE_STYLED, self::$formatting[$color_code]);
Expand Down

0 comments on commit 9b6fb6e

Please sign in to comment.