[devdocsgjs/main: 1376/1867] Improve syntax highlight of Sass
- From: Andy Holmes <andyholmes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devdocsgjs/main: 1376/1867] Improve syntax highlight of Sass
- Date: Fri, 19 Nov 2021 23:47:56 +0000 (UTC)
commit af46adfa416937e9348514c931ac52d158ca7a16
Author: MasterEnoc <brianhernandez222 hotmail com>
Date: Sun Dec 13 11:27:09 2020 -0600
Improve syntax highlight of Sass
lib/docs/filters/sass/clean_html.rb | 56 ++++---------------------------------
1 file changed, 5 insertions(+), 51 deletions(-)
---
diff --git a/lib/docs/filters/sass/clean_html.rb b/lib/docs/filters/sass/clean_html.rb
index db5c11ab..9f6c53fe 100644
--- a/lib/docs/filters/sass/clean_html.rb
+++ b/lib/docs/filters/sass/clean_html.rb
@@ -39,62 +39,16 @@ module Docs
css('.visuallyhidden').remove
### Syntax Highlight ###
- css('.kt').each do |node|
- node.remove_attribute('class')
- node.add_class('token constant')
+ css('.highlight.scss', '.highlight.sass').each do |node|
+ node['data-language'] = 'scss'
end
- css('.k, .kn, .kc, .cp, .ow').each do |node|
- node.remove_attribute('class')
- node.add_class('token keyword')
- end
-
- css('.nv, .no').each do |node|
- node.remove_attribute('class')
- node.add_class('token variable')
- end
-
- css('.nb, .n').each do |node|
- node.remove_attribute('class')
- node.add_class('token string')
- end
-
- css('.p').each do |node|
- node.remove_attribute('class')
- node.add_class('token punctuation')
- end
-
- css('.nf').each do |node|
- node.remove_attribute('class')
- node.add_class('token function')
- end
-
- css('.o').each do |node|
- node.remove_attribute('class')
- node.add_class('token operator')
- end
-
- css('.c1, .cm, .c').each do |node|
- node.remove_attribute('class')
- node.add_class('token comment')
- end
-
- css('.mh, .m, .mi').each do |node|
- node.remove_attribute('class')
- node.add_class('token number')
- end
-
- css('.nc, .nt').each do |node|
- node.remove_attribute('class')
- node.add_class('token selector')
- end
-
- css('.nl').each do |node|
- node.remove_attribute('class')
- node.add_class('token property')
+ css('.highlight.css').each do |node|
+ node['data-language'] = 'css'
end
doc
+
end
end
end
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]