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"): for tag in bs.find_all('div', class_="admonition"):
tag.clear() tag.clear()
# Skip code-sections, which just contains navigation instructions.
for tag in bs.find_all('div', class_="code-section"):
tag.clear()
text = '' text = ''
for paragraph in bs.find_all('p'): for paragraph in bs.find_all('p'):
# .text converts it from HTML to text # .text converts it from HTML to text

View File

@ -103,7 +103,9 @@ class OpenGraphTest(ZulipTestCase):
'/help/logging-out', '/help/logging-out',
"Logging out (Zulip Help Center)", "Logging out (Zulip Help Center)",
# Ideally we'd do something better here # 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: def test_index_pages(self) -> None:
self.check_title_and_description( self.check_title_and_description(