Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CID Support #281

Merged
merged 2 commits into from
Sep 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions add-on/src/lib/linkifyDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// linkify lock
window.ipfsLinkifiedDOM = true

const urlRE = /\s+(?:\/ip(f|n)s\/|fs:|ipns:|ipfs:)[^\s+"<>]+/g
const urlRE = /(?:\s+|^)(?:\/ip(f|n)s\/|fs:|ipns:|ipfs:)[^\s+"<>]+/g

// tags we will scan looking for un-hyperlinked IPFS addresses
const allowedParents = [
Expand Down Expand Up @@ -56,6 +56,7 @@
})

function linkifyContainer (container) {
// console.log('linkifyContainer', container)
if (!container.nodeType) {
return
}
Expand Down Expand Up @@ -85,7 +86,7 @@
}

function normalizeHref (href) {
console.log(href)
// console.log(href)
// convert various variants to regular URL at the public gateway
if (href.startsWith('ipfs:')) {
href = href.replace('ipfs:', '/ipfs/')
Expand All @@ -102,6 +103,7 @@
}

function linkifyTextNode (node) {
// console.log('linkifyTextNode', node)
let link
let match
const txt = node.textContent
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
},
"dependencies": {
"ipfs-api": "14.3.4",
"is-ipfs": "0.3.0",
"is-ipfs": "0.3.2",
"lru_map": "0.3.3",
"webextension-polyfill": "0.1.1"
}
Expand Down