Try fixing copy button flying out
This commit is contained in:
@@ -5,7 +5,7 @@ permalink: "/docs/history/"
|
||||
excerpt: Change log of enhancements and bug fixes made to the theme.
|
||||
sidebar:
|
||||
nav: docs
|
||||
last_modified_at: '2024-05-06T01:20:38+08:00'
|
||||
last_modified_at: '2024-05-06T21:06:31+08:00'
|
||||
toc: false
|
||||
---
|
||||
|
||||
@@ -17,6 +17,10 @@ toc: false
|
||||
{% raw %}
|
||||
## Unreleased
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix copy button going out of range for invalid syntax highlighting blocks.
|
||||
|
||||
### Enhancements
|
||||
|
||||
- Change the icon of a copy button into a tick for 1.5 seconds on successful copy.
|
||||
|
||||
@@ -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