diff --git a/apps/block_scout_web/assets/css/_code.scss b/apps/block_scout_web/assets/css/_code.scss index f6e2c8afc6..e466993e55 100644 --- a/apps/block_scout_web/assets/css/_code.scss +++ b/apps/block_scout_web/assets/css/_code.scss @@ -6,6 +6,22 @@ pre { white-space: pre-wrap; } +.pre-decompiled code { + white-space: pre-wrap; + counter-increment: line; +} + +.pre-decompiled code::before { + content: counter(line); + display: inline-block; + width: 2.5em; /* Fixed width */ + border-right: 1px solid #ddd; + padding: 0 .5em; + margin-right: .5em; + color: #888; + -webkit-user-select: none; +} + .pre-scrollable-shorty { max-height: $pre-scrollable-max-height / 7; } diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_decompiled_contract/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_decompiled_contract/index.html.eex index 141fd544bb..d2412d62c1 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_decompiled_contract/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_decompiled_contract/index.html.eex @@ -21,7 +21,7 @@
<%= raw(highlight_decompiled_code(contract.decompiled_source_code)) %>
+ <%= raw(highlight_decompiled_code(contract.decompiled_source_code)) %>
#{line}
\n"
+ end)
+ |> IO.inspect()
end
end