mirror of
https://github.com/misskey-dev/summerflare.git
synced 2025-04-29 02:37:17 +09:00
fix: support meta[name="twitter:card"]
This commit is contained in:
parent
5723ba50fd
commit
151d0b8d11
@ -3,10 +3,18 @@ import type { PrioritizedReference } from "../common";
|
||||
|
||||
export default function getCard(url: URL, html: HTMLRewriter) {
|
||||
const result: PrioritizedReference<string | null> = {
|
||||
bits: 1, // 0-1
|
||||
bits: 2, // 0-3
|
||||
priority: 0,
|
||||
content: null,
|
||||
};
|
||||
html.on('meta[name="twitter:card"]', {
|
||||
element(element) {
|
||||
const content = element.getAttribute("content");
|
||||
if (content) {
|
||||
assign(result, 2, content);
|
||||
}
|
||||
},
|
||||
});
|
||||
html.on('meta[property="twitter:card"]', {
|
||||
element(element) {
|
||||
const content = element.getAttribute("content");
|
||||
|
Loading…
x
Reference in New Issue
Block a user