fedimbed.bluesky: emojis my behated
This commit is contained in:
parent
edc0bf902d
commit
7f72b85e2b
1 changed files with 4 additions and 3 deletions
|
@ -240,17 +240,18 @@ async function bluesky(msg, url, spoiler = false) {
|
|||
|
||||
if (post.record.facets?.length > 0) {
|
||||
const splitString = [];
|
||||
const chars = [...mainEmbed.description]; // emojis...
|
||||
let start = 0;
|
||||
for (const facet of post.record.facets) {
|
||||
splitString.push({text: mainEmbed.description.substring(start, facet.index.byteStart)});
|
||||
splitString.push({text: chars.slice(start, facet.index.byteStart).join("")});
|
||||
|
||||
splitString.push({
|
||||
text: mainEmbed.description.substring(facet.index.byteStart, facet.index.byteEnd),
|
||||
text: chars.slice(facet.index.byteStart, facet.index.byteEnd).join(""),
|
||||
features: facet.features,
|
||||
});
|
||||
start = facet.index.byteEnd;
|
||||
}
|
||||
splitString.push({text: mainEmbed.description.substring(start)});
|
||||
splitString.push({text: chars.slice(start).join("")});
|
||||
|
||||
for (const part of splitString) {
|
||||
if (part.features)
|
||||
|
|
Loading…
Reference in a new issue