fix: tweet component id

This commit is contained in:
DIYgod
2023-05-19 16:56:41 +01:00
parent add4afcabc
commit 802489da24
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -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}" />`
},
}
+5 -1
View File
@@ -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()
-1
View File
@@ -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,