fixes incorrect embed URL concatenation

This commit is contained in:
msramalho
2022-04-05 10:24:44 +02:00
parent cd8690436e
commit 4c1b220d75

View File

@@ -83,13 +83,15 @@ class TelegramEmbed extends Component {
render() {
const { src, height } = this.state;
const { container } = this.props;
const embedSrc = new URL(src);
embedSrc.searchParams.append("embed", "1");
return (
<div data-sharing-id={container} style={containerStyles}>
<iframe
title={src}
ref={(node) => (this.iFrame = node)}
src={src + "?embed=1"}
src={embedSrc.toString()}
height={height}
id={
"telegram-post" + this.urlObj.pathname.replace(/[^a-z0-9_]/gi, "-")