fix: tweet component id
This commit is contained in:
@@ -14,6 +14,6 @@ export const TweetTransformer: Transformer = {
|
||||
const { pathname } = url
|
||||
const matched = match<{ id: string }>("/:user/status/:id")(pathname)
|
||||
if (!matched) return
|
||||
return `<tweet id=${matched.params.id}/>`
|
||||
return `<tweet id="${matched.params.id}" />`
|
||||
},
|
||||
}
|
||||
|
||||
@@ -27,7 +27,11 @@ export const rehypeEmbed: Plugin<
|
||||
const href = node.properties?.href
|
||||
|
||||
if (typeof href === "string") {
|
||||
const url = new URL(href)
|
||||
let url
|
||||
try {
|
||||
url = new URL(href)
|
||||
} catch (error) {}
|
||||
if (!url) return
|
||||
for (const transformer of transformers) {
|
||||
if (transformer.shouldTransform(url)) {
|
||||
const html = transformer.getHTML(url)?.trim()
|
||||
|
||||
@@ -15,7 +15,6 @@ export const useUnidata = () => {
|
||||
import("unidata.js").then(({ default: Unidata }) => {
|
||||
if (isConnected && connector) {
|
||||
connector?.getProvider().then((provider) => {
|
||||
console.log("provider", provider)
|
||||
setUnidata(
|
||||
new Unidata({
|
||||
ethereumProvider: provider,
|
||||
|
||||
Reference in New Issue
Block a user