ubyssey / ubyssey.ca

The code that powers www.ubyssey.ca
GNU General Public License v2.0
35 stars 40 forks source link

Make sure Ads don't go after very short p element #1464

Closed SamuelmdLow closed 1 month ago

SamuelmdLow commented 1 month ago

inject_ads in ubyssey_ad_filters.py ads inserts an ad after every 6 p elements and doesn't discriminate between elements with a lot of innerHTML and those that just have a few words. Sometimes articles have lists that don't use a p element instead of li. that means ads end up breaking up those lists after every items which is pretty bad. We should either only insert after p elements with "enough" innerHTML.

SamuelmdLow commented 1 month ago

Fixed by only including paragraphs with 75 or more characters