[devdocsgjs/main: 1034/1867] Syntax highlighting in Git docs
- From: Andy Holmes <andyholmes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devdocsgjs/main: 1034/1867] Syntax highlighting in Git docs
- Date: Fri, 19 Nov 2021 23:47:40 +0000 (UTC)
commit bad02f87ba71c558943ef2a0316ecb749e0b9285
Author: Jed Fox <git twopointzero us>
Date: Wed Jan 29 15:41:54 2020 -0500
Syntax highlighting in Git docs
lib/docs/filters/git/clean_html.rb | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/lib/docs/filters/git/clean_html.rb b/lib/docs/filters/git/clean_html.rb
index 6b76e1f0..b2433a76 100644
--- a/lib/docs/filters/git/clean_html.rb
+++ b/lib/docs/filters/git/clean_html.rb
@@ -42,6 +42,8 @@ module Docs
css('pre').each do |node|
node.content = node.content.gsub("\t", ' ' * 8)
+ node['data-language'] = 'shell' if node.content.starts_with?('git ')
+ node['data-language'] = 'shell-session' if node.content[0] == '$'
end
end
end
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]