Skip to content

Commit d1ade4c

Browse files
authored
Reformat assembly code display in AddressCodeTab (#794)
1 parent 601ca8f commit d1ade4c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/nextjs/app/blockexplorer/_components/AddressCodeTab.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ type AddressCodeTabProps = {
44
};
55

66
export const AddressCodeTab = ({ bytecode, assembly }: AddressCodeTabProps) => {
7-
const formattedAssembly = assembly.split(" ").join("\n");
7+
const formattedAssembly = Array.from(assembly.matchAll(/\w+( 0x[a-fA-F0-9]+)?/g))
8+
.map(it => it[0])
9+
.join("\n");
810

911
return (
1012
<div className="flex flex-col gap-3 p-4">

0 commit comments

Comments
 (0)