FIX: respect code indentation

FIX: respect code indentation

diff --git a/lib/onebox/mixins/git_blob_onebox.rb b/lib/onebox/mixins/git_blob_onebox.rb
index f95f1bf..f38e90c 100644
--- a/lib/onebox/mixins/git_blob_onebox.rb
+++ b/lib/onebox/mixins/git_blob_onebox.rb
@@ -115,7 +115,7 @@ module Onebox
           a_lines.each do |l|
             l = l.chomp("\n")  # remove new line
             m = l.match(/^[ ]*/) # find leading spaces 0 or more
-            unless m.nil? || l.size == m[0].size || m[0].size == 0 # no match | only spaces in line | empty line
+            unless m.nil? || l.size == m[0].size || l.size == 0 # no match | only spaces in line | empty line
               m_str_length = m[0].size
               if m_str_length <= 1  # minimum space is 1 or nothing we can break we found our minimum
                 min_space = m_str_length
diff --git a/templates/githubblob.mustache b/templates/githubblob.mustache
index b2311cb..56efefe 100644
--- a/templates/githubblob.mustache
+++ b/templates/githubblob.mustache
@@ -27,7 +27,7 @@ pre.onebox code li.selected{
 }
 </style>
 }}
-<pre class='onebox' ><code class='{{lang}}'><ol  class='start lines' start="{{cr_results.from}}" style='counter-reset: li-counter {{cr_results.from_minus_one}} ;'>
+<pre class='onebox' ><code class='{{lang}}'><ol class='start lines' start="{{cr_results.from}}" style='counter-reset: li-counter {{cr_results.from_minus_one}} ;'>
 {{#lines}}<li{{#selected}} class="selected"{{/selected}}>{{data}}</li>{{/lines}}
 </ol></code></pre>
 {{/has_lines}}

GitHub sha: 13af35fc

This commit has been mentioned on Discourse Meta. There might be relevant details there:

1 Like