fedimbed.bluesky: sanitize markdown
This commit is contained in:
parent
efcd4fbe7b
commit
3a5c4f6b10
1 changed files with 14 additions and 14 deletions
|
@ -360,6 +360,12 @@ async function blueskyQuoteEmbed(quote) {
|
|||
|
||||
const components = [];
|
||||
|
||||
let content = quote.value.text;
|
||||
if (quote.value.facets?.length > 0) {
|
||||
content = processBlueskyFacets(content, quote.value.facets);
|
||||
}
|
||||
content = content.replaceAll("`", "\u02cb").replaceAll("*", "\u2217").replaceAll("||", "|\u200b|");
|
||||
|
||||
const header = [
|
||||
{
|
||||
type: 10,
|
||||
|
@ -370,13 +376,7 @@ async function blueskyQuoteEmbed(quote) {
|
|||
components: [
|
||||
{
|
||||
type: 10,
|
||||
content: `## ${quote.author.displayName}\n-# [@${quote.author.handle}](https://bsky.app/profile/${
|
||||
quote.author.did
|
||||
})\n${
|
||||
quote.value.facets?.length ?? 0 > 0
|
||||
? processBlueskyFacets(quote.value.text, quote.value.facets)
|
||||
: quote.value.text
|
||||
}`,
|
||||
content: `## ${quote.author.displayName}\n-# [@${quote.author.handle}](https://bsky.app/profile/${quote.author.did})\n${content}`,
|
||||
},
|
||||
],
|
||||
accessory: {
|
||||
|
@ -648,6 +648,12 @@ async function bluesky(msg, url, spoiler = false) {
|
|||
})](https://bsky.app/profile/${reply.author.did}/post/${reply.uri.substring(reply.uri.lastIndexOf("/") + 1)})`;
|
||||
}
|
||||
|
||||
let content = post.record.text;
|
||||
if (post.record.facets?.length > 0) {
|
||||
content = processBlueskyFacets(content, post.record.facets);
|
||||
}
|
||||
content = content.replaceAll("`", "\u02cb").replaceAll("*", "\u2217").replaceAll("||", "|\u200b|");
|
||||
|
||||
const header = [
|
||||
context && {
|
||||
type: 10,
|
||||
|
@ -658,13 +664,7 @@ async function bluesky(msg, url, spoiler = false) {
|
|||
components: [
|
||||
{
|
||||
type: 10,
|
||||
content: `## ${post.author.displayName}\n-# [@${post.author.handle}](https://bsky.app/profile/${
|
||||
post.author.did
|
||||
})\n${
|
||||
post.record.facets?.length ?? 0 > 0
|
||||
? processBlueskyFacets(post.record.text, post.record.facets)
|
||||
: post.record.text
|
||||
}`,
|
||||
content: `## ${post.author.displayName}\n-# [@${post.author.handle}](https://bsky.app/profile/${post.author.did})\n${content}`,
|
||||
},
|
||||
],
|
||||
accessory: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue