GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Allows iframes containing youtube or vimeo videos. People like them · thusoy/python-readability@f1759c1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • readability
    • readability.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎readability/readability.py‎

Copy file name to clipboardExpand all lines: readability/readability.py
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#'trimRe': re.compile('^\s+|\s+$/'),
3333
#'normalizeRe': re.compile('\s{2,}/'),
3434
#'killBreaksRe': re.compile('(<br\s*\/?>(\s|&nbsp;?)*){1,}/'),
35-
#'videoRe': re.compile('http:\/\/(www\.)?(youtube|vimeo)\.com', re.I),
35+
'videoRe': re.compile('http:\/\/(www\.)?(youtube|vimeo)\.com', re.I),
3636
#skipFootnoteLink: /^\s*(\[?[a-z0-9]{1,2}\]?|^|edit|citation needed)\s*$/i,
3737
}
3838

@@ -428,8 +428,13 @@ def sanitize(self, node, candidates):
428428
if self.class_weight(header) < 0 or self.get_link_density(header) > 0.33:
429429
header.drop_tree()
430430

431-
for elem in self.tags(node, "form", "iframe", "textarea"):
431+
for elem in self.tags(node, "form", "textarea"):
432432
elem.drop_tree()
433+
434+
for elem in self.tags(node, "iframe"):
435+
if not ("src" in elem.attrib and REGEXES["videoRe"].search(elem.attrib["src"])):
436+
elem.drop_tree()
437+
433438
allowed = {}
434439
# Conditionally clean <table>s, <ul>s, and <div>s
435440
for el in self.reverse_tags(node, "table", "ul", "div"):

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.