Skip to content

Commit de37248

Browse files
committed
Fix some issues with curl_example nested in lists
Introduced when I added the live token banner
1 parent 5bee4e1 commit de37248

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/helpers.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ def login_url(text)
8080
path = "/oauth/authenticate?response_type=token"
8181

8282
url = "https://account.#{base_domain}#{path}&scope=#{scopes.join(' ')}&client_id=#{client_id}&redirect_uri="
83-
link = "\"<a href='#{url}\" + window.location + \"'>#{text}</a>\""
83+
link = "'<a href=\"#{url}' + window.location + '\">#{text}</a>'"
8484

8585
"<script>document.write(#{link})</script>"
8686
end
8787

8888
def access_token_banner()
8989
login_url = login_url("Authorize the App.net docs")
90-
"<div class=\"alert alert-success alert-block authorize-prompt hide\"><p>#{login_url} to see more complete examples.</p></div>\n"
90+
"<div class=\"alert alert-success alert-block authorize-prompt hide\"><p>#{login_url} to see more complete examples.</p></div>"
9191
end
9292

9393
def curl_example(method, path, response_key, options = {}, &block)
@@ -211,8 +211,7 @@ def curl_example(method, path, response_key, options = {}, &block)
211211
curl_lines << cur_line.strip
212212

213213
# use pre, code instead of a fenced code block so I can use these inside of markdown lists. Fenced code blocks don't work in md lists
214-
%{#{access_token_banner}
215-
<pre><code class="language-sh">#{curl_lines.join(" \\\n ")}</code></pre>
214+
%{#{access_token_banner}<pre><code class="language-sh">#{curl_lines.join(" \\\n ")}</code></pre>
216215
#{response}
217216
}
218217
end

0 commit comments

Comments
 (0)