diff --git a/packages/backend/src/config/sane-defaults.ts b/packages/backend/src/config/sane-defaults.ts new file mode 100644 index 000000000..2d9788c24 --- /dev/null +++ b/packages/backend/src/config/sane-defaults.ts @@ -0,0 +1 @@ +export const engine = "https://www.google.com/search?q=" diff --git a/packages/backend/src/mfm/to-html.ts b/packages/backend/src/mfm/to-html.ts index 8d8a4a888..a923d389e 100644 --- a/packages/backend/src/mfm/to-html.ts +++ b/packages/backend/src/mfm/to-html.ts @@ -3,6 +3,7 @@ import type * as mfm from "mfm-js"; import config from "@/config/index.js"; import { intersperse } from "@/prelude/array.js"; import type { IMentionedRemoteUsers } from "@/models/entities/note.js"; +import { engine } from "@/config/sane-defaults.js"; export function toHtml( nodes: mfm.MfmNode[] | null, @@ -156,7 +157,7 @@ export function toHtml( search(node) { const a = doc.createElement("a"); - a.href = `https://search.annoyingorange.xyz/search?q=${node.props.query}`; + a.href = `${engine}{node.props.query}`; a.textContent = node.props.content; return a; }, diff --git a/packages/client/src/components/MkGoogle.vue b/packages/client/src/components/MkGoogle.vue index cec493047..a69b09b7e 100644 --- a/packages/client/src/components/MkGoogle.vue +++ b/packages/client/src/components/MkGoogle.vue @@ -11,6 +11,7 @@