Try fixing copy button flying out
This commit is contained in:
33
docs/_posts/2009-10-06-edge-case-broken-highlighting.md
Normal file
33
docs/_posts/2009-10-06-edge-case-broken-highlighting.md
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
title: "Edge Case: Invalid syntax highlight languages"
|
||||
categories:
|
||||
- Edge Case
|
||||
tags:
|
||||
- content
|
||||
- css
|
||||
- edge case
|
||||
---
|
||||
|
||||
Good highlighting:
|
||||
|
||||
```ruby
|
||||
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)
|
||||
end
|
||||
```
|
Reference in New Issue
Block a user