Skip to content

Commit

Permalink
[bilibili.space] Recognize and handle RICH_TEXT_NODE_TYPE_BV
Browse files Browse the repository at this point in the history
  • Loading branch information
SpriteOvO committed Oct 21, 2024
1 parent 5e7b6b8 commit efcd845
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/source/platform/bilibili/space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ mod data {
PostContentPart::Plain(node.orig_text.clone())
}
}
RichTextNodeKind::Bv { rid, .. } => PostContentPart::Link {
display: node.text.clone(),
url: format!("https://www.bilibili.com/video/{rid}"),
},
// We treat these nodes as plain text
RichTextNodeKind::Emoji { .. } | RichTextNodeKind::Lottery { .. } => {
PostContentPart::Plain(node.orig_text.clone())
Expand Down Expand Up @@ -329,6 +333,8 @@ mod data {
Topic { jump_url: String },
#[serde(rename = "RICH_TEXT_NODE_TYPE_LOTTERY")]
Lottery { rid: String },
#[serde(rename = "RICH_TEXT_NODE_TYPE_BV")]
Bv { jump_url: String, rid: String },
#[serde(untagged)]
Unknown(json::Value),
}
Expand Down

0 comments on commit efcd845

Please sign in to comment.