DEV: Format mustache templates (#473)

DEV: Format mustache templates (#473)

Correct indentation, whitespace, and double-quotes.

diff --git a/spec/lib/onebox/engine/github_folder_onebox_spec.rb b/spec/lib/onebox/engine/github_folder_onebox_spec.rb
index 28c6515..cd089c8 100644
--- a/spec/lib/onebox/engine/github_folder_onebox_spec.rb
+++ b/spec/lib/onebox/engine/github_folder_onebox_spec.rb
@@ -15,7 +15,7 @@ describe Onebox::Engine::GithubFolderOnebox do
 
     describe "#to_html" do
       it "includes link to folder with truncated display path" do
-        expect(html).to include("<a href='https://github.com/discourse/discourse/tree/master/spec/fixtures' target=\"_blank\" rel=\"noopener\">master/spec/fixtures</a>")
+        expect(html).to include("<a href=\"https://github.com/discourse/discourse/tree/master/spec/fixtures\" target=\"_blank\" rel=\"noopener\">master/spec/fixtures</a>")
       end
 
       it "includes repository name" do
@@ -38,7 +38,7 @@ describe Onebox::Engine::GithubFolderOnebox do
     end
 
     it "extracts subtitles when linking to docs" do
-      expect(@onebox.to_html).to include("<a href='https://github.com/discourse/discourse#setting-up-discourse' target=\"_blank\" rel=\"noopener\">discourse/discourse - Setting up Discourse</a>")
+      expect(@onebox.to_html).to include("<a href=\"https://github.com/discourse/discourse#setting-up-discourse\" target=\"_blank\" rel=\"noopener\">discourse/discourse - Setting up Discourse</a>")
     end
   end
 
diff --git a/templates/_layout.mustache b/templates/_layout.mustache
index e6008f3..9075319 100644
--- a/templates/_layout.mustache
+++ b/templates/_layout.mustache
@@ -3,19 +3,23 @@
     {{#favicon}}
       <img src="{{favicon}}" class="site-icon"/>
     {{/favicon}}
+
     {{#article_published_time}}
-      <a href="{{link}}" target='_blank' rel='noopener' title="{{article_published_time_title}}">{{domain}} &ndash; {{article_published_time}}</a>
+      <a href="{{link}}" target="_blank" rel="noopener" title="{{article_published_time_title}}">{{domain}} &ndash; {{article_published_time}}</a>
     {{/article_published_time}}
     {{^article_published_time}}
-      <a href="{{link}}" target='_blank' rel='noopener'>{{domain}}</a>
+      <a href="{{link}}" target="_blank" rel="noopener">{{domain}}</a>
     {{/article_published_time}}
   </header>
+
   <article class="onebox-body">
     {{{view}}}
   </article>
+
   <div class="onebox-metadata">
     {{#metadata_1_label}}<span style="float: left;">{{metadata_1_label}}: {{metadata_1_value}}</span>{{/metadata_1_label}}
     {{#metadata_2_label}}<span style="float: right;">{{metadata_2_label}}: {{metadata_2_value}}</span>{{/metadata_2_label}}
   </div>
+
   <div style="clear: both"></div>
 </aside>
diff --git a/templates/allowlistedgeneric.mustache b/templates/allowlistedgeneric.mustache
index d937314..0d0fde9 100644
--- a/templates/allowlistedgeneric.mustache
+++ b/templates/allowlistedgeneric.mustache
@@ -1,6 +1,6 @@
 {{#image}}<img src="{{image}}" class="thumbnail"/>{{/image}}
 
-<h3><a href='{{link}}' target="_blank" rel="noopener">{{title}}</a></h3>
+<h3><a href="{{link}}" target="_blank" rel="noopener">{{title}}</a></h3>
 
 {{#description}}
 <p>{{description}}</p>
diff --git a/templates/amazon.mustache b/templates/amazon.mustache
index 7a99d7f..e5a3c61 100644
--- a/templates/amazon.mustache
+++ b/templates/amazon.mustache
@@ -1,8 +1,11 @@
-{{#image}}<img src="{{image}}" class="thumbnail"/>{{/image}}
+{{#image}}<img src="{{image}}" class="thumbnail">{{/image}}
+
+<h3><a href="{{link}}" target="_blank" rel="noopener">{{title}}</a></h3>
 
-<h3><a href='{{link}}' target='_blank' rel='noopener'>{{title}}</a></h3>
 {{#by_info}}<b>{{by_info}}</b>{{/by_info}}
+
 <p>{{description}}</p>
+
 <p>
   {{#rating}}{{rating}}{{/rating}}
   {{#isbn_asin}}{{isbn_asin_text}}: {{isbn_asin}}, {{/isbn_asin}}
diff --git a/templates/githubblob.mustache b/templates/githubblob.mustache
index 2cf9af5..810c9ce 100644
--- a/templates/githubblob.mustache
+++ b/templates/githubblob.mustache
@@ -1,42 +1,52 @@
 <h4><a href="{{link}}" target="_blank" rel="noopener">{{title}}</a></h4>
+
 {{^has_lines}}
-{{#model_file}}
-<iframe class="render-viewer" width="{{width}}" height="{{height}}" src="{{content}}" sandbox="allow-scripts allow-same-origin allow-top-navigation ">
-Viewer requires iframe.
-</iframe>
-{{/model_file}}
-{{^model_file}}
-<pre><code class='{{lang}}'>{{content}}</code></pre>
-{{/model_file}}
+  {{#model_file}}
+    <iframe class="render-viewer" width="{{width}}" height="{{height}}" src="{{content}}" sandbox="allow-scripts allow-same-origin allow-top-navigation ">
+      Viewer requires iframe.
+    </iframe>
+  {{/model_file}}
+
+  {{^model_file}}
+    <pre><code class="{{lang}}">{{content}}</code></pre>
+  {{/model_file}}
 {{/has_lines}}
+
 {{#has_lines}}
-{{! This is a template comment  | Sample rules for this box
-<style>
-pre.onebox code ol{
-	margin-left:0px;
-}
-pre.onebox code ol .lines{
-	margin-left:30px;
-}
-pre.onebox code ol.lines li {
-	list-style-type: decimal;
-	margin-left:45px;
-}
-pre.onebox code li{
-	list-style-type: none;
-	background-color:#fff;
-	border-bottom:1px solid #F0F0F0;
-	padding-left:5px;
+  {{! This is a template comment  | Sample rules for this box
+  <style>
+  pre.onebox code ol{
+    margin-left:0px;
+  }
+  pre.onebox code ol .lines{
+    margin-left:30px;
+  }
+  pre.onebox code ol.lines li {
+    list-style-type: decimal;
+    margin-left:45px;
+  }
+  pre.onebox code li{
+    list-style-type: none;
+    background-color:#fff;
+    border-bottom:1px solid #F0F0F0;
+    padding-left:5px;
+
+  }
+  pre.onebox code li.selected{
+    background-color:#cfc
+  }
+  </style>
+  }}
 
-}
-pre.onebox code li.selected{
-	background-color:#cfc
-}
-</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}} ;'>
-{{#lines}}<li{{#selected}} class="selected"{{/selected}}>{{data}}</li>{{/lines}}
-</ol></code></pre>
+  <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}}
 
 {{#truncated}}
diff --git a/templates/githubcommit.mustache b/templates/githubcommit.mustache
index 5b28e22..b9d15cb 100644
--- a/templates/githubcommit.mustache
+++ b/templates/githubcommit.mustache
@@ -10,7 +10,7 @@
 
     <div class="github-info">
       <div class="date">
-        committed <span class="discourse-local-date" data-format='ll' data-date="{{committed_at_date}}" data-time="{{committed_at_time}}" data-timezone="UTC">{{committed_at}}</span>
+        committed <span class="discourse-local-date" data-format="ll" data-date="{{committed_at_date}}" data-time="{{committed_at_time}}" data-timezone="UTC">{{committed_at}}</span>
       </div>
 
       <div class="user">
@@ -18,7 +18,6 @@
           <img alt="{{author.login}}" src="{{author.avatar_url}}" class="onebox-avatar-inline" width="20" height="20">
           {{author.login}}
         </a>
-
       </div>
 
       <div class="lines" title="changed {{files.length}} files with {{stats.additions}} additions and {{stats.deletions}} deletions">
@@ -28,7 +27,6 @@
         </a>
       </div>
     </div>
-
   </div>
 </div>
 
diff --git a/templates/githubfolder.mustache b/templates/githubfolder.mustache
index 506ea71..cac5d38 100644
--- a/templates/githubfolder.mustache
+++ b/templates/githubfolder.mustache
@@ -1,9 +1,9 @@
 {{#image}}<img src="{{image}}" class="thumbnail"/>{{/image}}
 
-<h3><a href='{{link}}' target="_blank" rel="noopener">{{title}}</a></h3>
+<h3><a href="{{link}}" target="_blank" rel="noopener">{{title}}</a></h3>
 
 {{#path}}
-<p><a href='{{link}}' target="_blank" rel="noopener">{{path}}</a></p>
+  <p><a href="{{link}}" target="_blank" rel="noopener">{{path}}</a></p>
 {{/path}}
 
 {{#description}}

[... diff too long, it was truncated ...]

GitHub sha: 907be5bf

This commit appears in #473 which was approved by eviltrout. It was merged by CvX.