Skip to content

Commit 4a11edb

Browse files
ZHENG-Qi625Nourhane Boudaoud
andauthored
Update FormattedText.jsx (Supprimer tous les commentaires)
Co-authored-by: Nourhane Boudaoud <@NourhaneBoudaoud>, LI Zhenpeng <@LZPxka>
1 parent 1e3ead9 commit 4a11edb

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

frontend/src/components/FormattedText.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ import CroppedImage from './CroppedImage';
66
import VideoComment from './VideoComment';
77
import FragmentComment from './FragmentComment';
88

9-
// Extrait l'ID YouTube depuis un lien
109
function getId(text) {
1110
if (!text) return null;
1211
const regExp = /^.*(?:youtube\.com\/watch\?v=|youtu\.be\/)([^\s&]{11})/;
1312
const match = text.match(regExp);
1413
return match ? match[1] : null;
1514
}
1615

17-
// Pour gérer les balises img qui pointent vers YouTube
1816
function embedVideo({ src }) {
1917
const videoId = getId(src);
2018
if (videoId) {
@@ -34,7 +32,6 @@ function FormattedText({ children, setHighlightedText, selectable, setSelectedTe
3432
}
3533
};
3634

37-
// Nouveau rendu pour <a> : transforme les liens YouTube purs en iframe
3835
const renderLinkOrVideo = ({ children, href }) => {
3936
const videoId = getId(href);
4037
if (videoId) {

0 commit comments

Comments
 (0)