Ipfs-companion: Linkify rendering issue

Created on 24 Jul 2018  Â·  3Comments  Â·  Source: ipfs/ipfs-companion

I'm currently on the beta version 2.4.2.10500 (9424acc)

Partial hashes seem to render incorrectly. I noticed the body of one of my emails looked wrong with this string

file {
data: ...
metadata: /ipfs/Qm... | /ipns/Qm...
}

it's rendering like this in Gmail

2

and as
untitled

when viewed as a txt file

kinbug

Most helpful comment

Similar issue: "ipfs cat /pfs/QmId" renders as "/ipfs/QmId". Example:

ipfs cat /ipfs/QmId

(note: "ipfs cat /pfs/QmId" renders fine because my i isn't actually an i :smiling_imp: ).

All 3 comments

Ack, this is a side effect of Linkify – our fun and invasive experiment that mutates DOM :upside_down_face:

[note to self] fix for this:
a) linkify should just ignore <pre> blocks (high now we only ignore styled ones, but it is not enough)
b) linkify should not run on if content-type is text/plain (sample)
c) linkify should not wrap false-positives in a <span> – we already cache IPFS validation in a map per page, so its safe to do it every time DOM chunk with false-positive is mutated

Similar issue: "ipfs cat /pfs/QmId" renders as "/ipfs/QmId". Example:

ipfs cat /ipfs/QmId

(note: "ipfs cat /pfs/QmId" renders fine because my i isn't actually an i :smiling_imp: ).

FYI the fix landed in v2.4.4. :+1:

Was this page helpful?
0 / 5 - 0 ratings