app/views/lookbook/components/_code.html.erb in lookbook-0.7.2.beta.0 vs app/views/lookbook/components/_code.html.erb in lookbook-0.7.2.beta.1
- old
+ new
@@ -1,13 +1,17 @@
<%
-line_numbers ||= false
language ||= "html"
wrap ||= nil;
%>
<% code ||= capture do %><%= yield %><% end %>
-<div class="code not-prose <%= "numbered" if line_numbers %> <%= classes ||= "" %>"
+<% output = highlight(code, language, {
+ strip: defined?(strip) ? strip : true,
+ line_numbers: line_numbers ||= false,
+ highlight_lines: highlight_lines ||= [],
+ start_line: start_line ||= 0
+}) %>
+<div class="code not-prose <%= "numbered" if line_numbers %> <%= classes ||= "" %> <%= "focussed" if highlight_lines.any? %>"
x-data="code"
:class="{'wrapped': wrap}"
- <% if wrap.present? %>x-effect="wrap = <%= wrap %>"<% end %>
->
- <pre><code class="highlight"><%= highlight(code.strip, language, line_numbers: line_numbers) %></code></pre>
+ <% if wrap.present? %>x-effect="wrap = <%= wrap %>"<% end %>>
+ <pre><code class="highlight"><%= output %></code></pre>
</div>
\ No newline at end of file