grgr.me

latest commits to https://grgr.me/
Log | Files | Refs

commit ace99ea7c5719aa1b04e397eeae8ba6428df248e
parent fc7c856ddaf363cc51ab2ba986c9fcb4ef7dd3d9
Author: corndog <cauchyn@firemail.cc>
Date:   Sat, 29 Sep 2018 23:49:59 -0700

Don't add embed button if in nested list or in p

Diffstat:
youtube-embed.py | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/youtube-embed.py b/youtube-embed.py @@ -11,6 +11,8 @@ for li in lists: anchor = li.find('a') if not anchor: continue + elif anchor.parent.name == "p" or len(anchor.find_parents("ul")) > 1: + continue elif "youtube.com" in anchor['href']: leftSide = True if len(anchor.get_text()) < 32 else False vid = anchor['href'].split('=')[1]