Skip to content
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
2 changes: 1 addition & 1 deletion deps/scrapbox-rest.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "https://raw.githubusercontent.com/takker99/scrapbox-userscript-std/0.24.3/rest/mod.ts";
export * from "https://raw.githubusercontent.com/scrapbox-jp/types/0.5.0/rest.ts";
export * from "https://raw.githubusercontent.com/scrapbox-jp/types/0.6.0/rest.ts";
4 changes: 2 additions & 2 deletions deps/scrapbox.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from "https://raw.githubusercontent.com/takker99/scrapbox-userscript-std/0.24.3/browser/dom/mod.ts";
export * from "https://raw.githubusercontent.com/takker99/scrapbox-userscript-std/0.24.3/title.ts";
export type { Scrapbox } from "https://raw.githubusercontent.com/scrapbox-jp/types/0.5.0/userscript.ts";
export * from "https://raw.githubusercontent.com/scrapbox-jp/types/0.5.0/rest.ts";
export type { Scrapbox } from "https://raw.githubusercontent.com/scrapbox-jp/types/0.6.0/userscript.ts";
export * from "https://raw.githubusercontent.com/scrapbox-jp/types/0.6.0/rest.ts";
8 changes: 2 additions & 6 deletions middlewares/formatTweet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ const defaultFormat = async (
): Promise<string> => {
if ("images" in tweet) {
return [
`[${escapeForEmbed(tweet.screenName)}(@${
escapeForEmbed(tweet.userName)
}) ${url.origin}${url.pathname}]`,
`[@${escapeForEmbed(tweet.screenName)} ${url.origin}${url.pathname}]`,
...tweet.description.split("\n").map((line) =>
`> ${escapeForEmbed(line)}`
),
Expand Down Expand Up @@ -71,9 +69,7 @@ const stringify = async ({ content, author, id }: ProcessedTweet) => {
const url = new URL(`https://twitter.com/${author.screenName}/status/${id}`);

return [
`[${escapeForEmbed(author.name)}(@${
escapeForEmbed(author.screenName)
}) ${url}]`,
`[@${escapeForEmbed(author.screenName)} ${url}]`,
...(await Promise.all(content.map(async (node) => {
switch (node.type) {
case "plain":
Expand Down