We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7090d80 commit 0c30e8eCopy full SHA for 0c30e8e
lib/multilang.rb
@@ -1,9 +1,13 @@
1
module Multilang
2
def block_code(code, full_lang_name)
3
- parts = full_lang_name.split('--')
4
- rouge_lang_name = (parts) ? parts[0] : "" # just parts[0] here causes null ref exception when no language specified
5
- super(code, rouge_lang_name).sub("highlight #{rouge_lang_name}") do |match|
6
- match + " tab-" + full_lang_name
+ if full_lang_name
+ parts = full_lang_name.split('--')
+ rouge_lang_name = (parts) ? parts[0] : "" # just parts[0] here causes null ref exception when no language specified
+ super(code, rouge_lang_name).sub("highlight #{rouge_lang_name}") do |match|
7
+ match + " tab-" + full_lang_name
8
+ end
9
+ else
10
+ super(code, full_lang_name)
11
end
12
13
0 commit comments