mirror of
https://github.com/damus-io/notecrumbs.git
synced 2024-09-20 21:56:33 +00:00
escape html in opengraph properties
This commit is contained in:
parent
3971be30b0
commit
b86a552cde
@ -1,5 +1,6 @@
|
|||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
|
|
||||||
|
use html_escape;
|
||||||
use http_body_util::Full;
|
use http_body_util::Full;
|
||||||
use hyper::body::Bytes;
|
use hyper::body::Bytes;
|
||||||
use hyper::header;
|
use hyper::header;
|
||||||
@ -155,8 +156,9 @@ fn serve_note_html(
|
|||||||
// 4: Full content
|
// 4: Full content
|
||||||
|
|
||||||
let hostname = "https://damus.io";
|
let hostname = "https://damus.io";
|
||||||
let abbrev_content = abbreviate(¬e.note.content, 64);
|
let abbrev_content = html_escape::encode_text(abbreviate(¬e.note.content, 64));
|
||||||
let content = ¬e.note.content;
|
let content = html_escape::encode_text(¬e.note.content);
|
||||||
|
let profile_name = html_escape::encode_text(¬e.profile.name);
|
||||||
|
|
||||||
write!(
|
write!(
|
||||||
data,
|
data,
|
||||||
@ -192,7 +194,7 @@ fn serve_note_html(
|
|||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
"#,
|
"#,
|
||||||
note.profile.name,
|
profile_name,
|
||||||
abbrev_content,
|
abbrev_content,
|
||||||
hostname,
|
hostname,
|
||||||
nip19.to_bech32().unwrap(),
|
nip19.to_bech32().unwrap(),
|
||||||
|
Loading…
Reference in New Issue
Block a user