create a mechanism for substring replacement within HTML elements #535
Labels
enhancement
New feature or request
non-address labelling
For labelling of things other than addresses
performance
Ideally rolod0x would be able to detect and label addresses even when they're substrings within an HTML element surrounded by other text, e.g.
However as previously mentioned in #531 (comment), so far rolod0x can only detect labelling opportunities when the entire contents of an HTML element is recognised in the pre-computed mapping (modulo trailing/leading whitespace), e.g.
(Actually it can also recognise addresses in
href
attributes, but that's a special case.)This limited approach to matching was a deliberate design choice in order to keep the extension as performant as possible, based on the assumption that more complex approaches to address detection such as compiling and using gigantic regular expressions would be far too costly to apply to every HTML element of a page. And fortunately it does catch the vast majority of cases successfully.
However, it does undesirably exclude some cases, e.g.
eth:
or similar, e.g. according to ERC-3770. https://app.safe.global and similar sites do this, for instance - although luckily they tend to wrap the address in a separate HTML element to the prefix so in practice this is rarely an issue.So ideally we could implement a mechanism for substring replacement without harming performance. Possible solutions:
The text was updated successfully, but these errors were encountered: