open graph: Omit .code-section navigation from open graph.

This commit is contained in:
Rishi Gupta 2019-02-10 22:03:55 -08:00 committed by Tim Abbott
parent e1f02dc6f2
commit d3125f59e1
2 changed files with 7 additions and 1 deletions

View File

@ -460,6 +460,10 @@ class FinalizeOpenGraphDescription(MiddlewareMixin):
for tag in bs.find_all('div', class_="admonition"):
tag.clear()
# Skip code-sections, which just contains navigation instructions.
for tag in bs.find_all('div', class_="code-section"):
tag.clear()
text = ''
for paragraph in bs.find_all('p'):
# .text converts it from HTML to text

View File

@ -103,7 +103,9 @@ class OpenGraphTest(ZulipTestCase):
'/help/logging-out',
"Logging out (Zulip Help Center)",
# Ideally we'd do something better here
["Click on the gear () icon in", "Click Log out. Tap the menu"], [])
["We're here to help! Email us at zulip-admin@example.com with questions, feedback, or " +
"feature requests."],
["Click on the gear"])
def test_index_pages(self) -> None:
self.check_title_and_description(