Skip to content

Commit 702c176

Browse files
committed
Update deps
1 parent 3b840a9 commit 702c176

File tree

3 files changed

+27
-20
lines changed

3 files changed

+27
-20
lines changed

lib/components_guide_web/controllers/research_controller.ex

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,8 @@ defmodule ComponentsGuideWeb.ResearchView do
459459
<ul>
460460
<li>Status: <%= caniuse_status(@status) %></li>
461461
<li><.link href={@spec}>Read the spec</.link></li>
462-
<%= for %{"title" => title, "url" => url} <- links do %>
463-
<li><.link href={url}><%= title %></.link></li>
462+
<%= for link <- @links do %>
463+
<li><.link href={link["url"]}><%= link["title"] %></.link></li>
464464
<% end %>
465465
</ul>
466466
<dl>
@@ -493,28 +493,28 @@ defmodule ComponentsGuideWeb.ResearchView do
493493
<:title><%= "#{@name} Spec" %></:title>
494494
<%= Section.description_list([
495495
{"Specs",
496-
specs
496+
@specs
497497
|> Enum.map(fn
498498
"rfc" <> _ = spec -> link(spec, to: "https://tools.ietf.org/html/" <> spec)
499499
spec -> spec
500500
end)
501501
|> Section.unordered_list(class: "flex list-disc ml-4 space-x-8")},
502-
{"Media (MIME) Type", Keyword.get(metadata, :media_type)}
502+
{"Media (MIME) Type", Keyword.get(@metadata, :media_type)}
503503
]) %>
504504
</.card>
505505
"""
506506
end
507507

508-
def super_tiny_icon(%{name: name, url: url, urls: urls} = assigns) do
508+
def super_tiny_icon(%{name: _, url: _, urls: _} = assigns) do
509509
~H"""
510510
<.card source="Super Tiny Icons" source_url="https://www.supertinyicons.org/">
511-
<:title><%= "#{name |> String.capitalize()} Icon" %></:title>
511+
<:title><%= "#{@name |> String.capitalize()} Icon" %></:title>
512512
<div class="flex flex-row space-x-4">
513513
<img src={@url} width={80} height={80}>
514514
<.description_list>
515-
<:item title="URL" data={for(url <- urls, do: link(url, to: url))} />
515+
<:item title="URL" data={for(url <- @urls, do: link(url, to: url))} />
516516
<:item title="Size">
517-
<%= client_include("/~/content-length?" <> URI.encode_query(url: url), "loading…") %>
517+
<%= client_include("/~/content-length?" <> URI.encode_query(url: @url), "loading…") %>
518518
</:item>
519519
</.description_list>
520520
</div>

lib/components_guide_web/template_engines/markdown_engine.ex

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ defmodule ComponentsGuideWeb.TemplateEngines.MarkdownEngine do
5656
{nil, markdown}
5757
end
5858

59-
6059
# |> Earmark.as_html!(%Earmark.Options{code_class_prefix: "language-", smartypants: false, postprocessor: &map_ast/1})
6160

6261
# html = Regex.replace(regex, html, fn whole, name, content -> "!" <> name <> "!" <> content end)
@@ -71,12 +70,19 @@ defmodule ComponentsGuideWeb.TemplateEngines.MarkdownEngine do
7170

7271
s ->
7372
html = Earmark.as_html!(markdown, options)
73+
7474
quote do
7575
unquote(Code.string_to_quoted!(s, file: path))
7676

7777
unquote(
7878
html
79-
|> EEx.compile_string(engine: Phoenix.LiveView.HTMLEngine, file: path, line: 1)
79+
|> EEx.compile_string(
80+
engine: Phoenix.LiveView.HTMLEngine,
81+
file: path,
82+
line: 1,
83+
caller: __ENV__,
84+
source: html
85+
)
8086
)
8187
end
8288
end

0 commit comments

Comments
 (0)