Disable copy button for bad pre blocks
This commit is contained in:
@ -21,13 +21,28 @@ if str
|
||||
end
|
||||
```
|
||||
|
||||
Good (but dumb) highlighting:
|
||||
|
||||
```
|
||||
str = ARGV.first
|
||||
if str
|
||||
str = str.b[/\A_(.*)_\z/, 1]
|
||||
if str and Gem::Version.correct?(str)
|
||||
version = str
|
||||
ARGV.shift
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
Bad highlighting:
|
||||
|
||||
```invalid
|
||||
if Gem.respond_to?(:activate_bin_path)
|
||||
load Gem.activate_bin_path('jekyll', 'jekyll', version)
|
||||
else
|
||||
gem "jekyll", version
|
||||
load Gem.bin_path("jekyll", "jekyll", version)
|
||||
str = ARGV.first
|
||||
if str
|
||||
str = str.b[/\A_(.*)_\z/, 1]
|
||||
if str and Gem::Version.correct?(str)
|
||||
version = str
|
||||
ARGV.shift
|
||||
end
|
||||
end
|
||||
```
|
||||
|
Reference in New Issue
Block a user