提交 57f8b24f 编写于 作者: T Tony Rom

Fix minors

上级 d90d141c
......@@ -19,21 +19,19 @@
.gfm-color_chip {
display: inline-block;
margin-left: 4px;
margin-bottom: 2px;
margin: 0 0 2px 4px;
vertical-align: middle;
border-radius: 3px;
$side: 0.9em;
$bg-size: $side / 0.9;
$chip-size: 0.9em;
$bg-size: $chip-size / 0.9;
$bg-pos: $bg-size / 2;
$bg-color: $gray-dark;
width: $side;
height: $side;
width: $chip-size;
height: $chip-size;
background: $white-light;
background-image: linear-gradient(135deg, $bg-color 25%, transparent 0%, transparent 75%, $bg-color 0%),
linear-gradient(135deg, $bg-color 25%, transparent 0%, transparent 75%, $bg-color 0%);
background-image: linear-gradient(135deg, $gray-dark 25%, transparent 0%, transparent 75%, $gray-dark 0%),
linear-gradient(135deg, $gray-dark 25%, transparent 0%, transparent 75%, $gray-dark 0%);
background-size: $bg-size $bg-size;
background-position: 0 0, $bg-pos $bg-pos;
......
......@@ -30,21 +30,15 @@ module Banzai
FORMATS = [HEX_FORMAT, RGB_FORMAT, HSL_FORMAT].freeze
class << self
# Public: Analyzes whether the String is a color code.
#
# text - The String to be parsed.
#
# Returns the recognized color String or nil if none was found.
def parse(text)
text if color_format =~ text
end
COLOR_FORMAT = /\A(#{Regexp.union(FORMATS)})\z/ix
private
def color_format
@color_format ||= /\A(#{Regexp.union(FORMATS)})\z/ix
end
# Public: Analyzes whether the String is a color code.
#
# text - The String to be parsed.
#
# Returns the recognized color String or nil if none was found.
def self.parse(text)
text if COLOR_FORMAT =~ text
end
end
end
......@@ -130,11 +130,11 @@ describe('GfmAutoComplete', function () {
});
describe('should not match special sequences', () => {
const ShouldNotBeFollowedBy = flags.concat(['\x00', '\x10', '\x3f', '\n', ' ']);
const ShouldNotBePrependedBy = ['`'];
const shouldNotBeFollowedBy = flags.concat(['\x00', '\x10', '\x3f', '\n', ' ']);
const shouldNotBePrependedBy = ['`'];
flagsUseDefaultMatcher.forEach((atSign) => {
ShouldNotBeFollowedBy.forEach((followedSymbol) => {
shouldNotBeFollowedBy.forEach((followedSymbol) => {
const seq = atSign + followedSymbol;
it(`should not match "${seq}"`, () => {
......@@ -142,7 +142,7 @@ describe('GfmAutoComplete', function () {
});
});
ShouldNotBePrependedBy.forEach((prependedSymbol) => {
shouldNotBePrependedBy.forEach((prependedSymbol) => {
const seq = prependedSymbol + atSign;
it(`should not match "${seq}"`, () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册