diff --git a/web/src/portico/help.js b/web/src/portico/help.js index f743f9e6ec..ec536c0468 100644 --- a/web/src/portico/help.js +++ b/web/src/portico/help.js @@ -77,7 +77,7 @@ function add_copy_to_clipboard_element($codehilite) { } function render_tabbed_sections() { - $(".code-section").each(function () { + $(".tabbed-section").each(function () { activate_correct_tab($(this)); register_tabbed_section($(this)); }); diff --git a/web/src/portico/tabbed-instructions.ts b/web/src/portico/tabbed-instructions.ts index f8cd20113e..ccf65b5c57 100644 --- a/web/src/portico/tabbed-instructions.ts +++ b/web/src/portico/tabbed-instructions.ts @@ -67,6 +67,6 @@ export function activate_correct_tab($codeSection: JQuery): void { } } -$(".code-section").each(function () { +$(".tabbed-section").each(function () { activate_correct_tab($(this)); }); diff --git a/web/styles/portico/markdown.css b/web/styles/portico/markdown.css index 31ca652b60..09fdf9e4db 100644 --- a/web/styles/portico/markdown.css +++ b/web/styles/portico/markdown.css @@ -419,7 +419,7 @@ } } - .code-section { + .tabbed-section { & ol { margin-left: 15px; margin-top: 10px; diff --git a/web/styles/portico/portico.css b/web/styles/portico/portico.css index 9ef916cb32..da270c5aea 100644 --- a/web/styles/portico/portico.css +++ b/web/styles/portico/portico.css @@ -64,7 +64,7 @@ html { /* The API tabbed content tends to have a lot of code blocks, which look nicer against a different background */ -.api-center .code-section { +.api-center .tabbed-section { .blocks { background-color: hsl(0deg 0% 98%); } diff --git a/zerver/lib/html_to_text.py b/zerver/lib/html_to_text.py index d23ba2d673..7094bc0552 100644 --- a/zerver/lib/html_to_text.py +++ b/zerver/lib/html_to_text.py @@ -16,8 +16,8 @@ def html_to_text(content: Union[str, bytes], tags: Mapping[str, str] = {"p": " | 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"): + # Skip tabbed-sections, which just contain navigation instructions. + for tag in bs.find_all("div", class_="tabbed-section"): tag.clear() text = "" diff --git a/zerver/lib/markdown/tabbed_sections.py b/zerver/lib/markdown/tabbed_sections.py index 693c636715..7012a405cb 100644 --- a/zerver/lib/markdown/tabbed_sections.py +++ b/zerver/lib/markdown/tabbed_sections.py @@ -11,8 +11,8 @@ START_TABBED_SECTION_REGEX = re.compile(r"^\{start_tabs\}$") END_TABBED_SECTION_REGEX = re.compile(r"^\{end_tabs\}$") TAB_CONTENT_REGEX = re.compile(r"^\{tab\|\s*(.+?)\s*\}$") -CODE_SECTION_TEMPLATE = """ -
+TABBED_SECTION_TEMPLATE = """ +
{nav_bar}
{blocks} @@ -131,7 +131,7 @@ class TabbedSectionsPreprocessor(Preprocessor): ] nav_bar = self.generate_nav_bar(tab_section) content_blocks = self.generate_content_blocks(tab_section, lines) - rendered_tabs = CODE_SECTION_TEMPLATE.format( + rendered_tabs = TABBED_SECTION_TEMPLATE.format( tab_class=tab_class, nav_bar=nav_bar, blocks=content_blocks ) diff --git a/zerver/tests/test_templates.py b/zerver/tests/test_templates.py index 7c658585bd..65fe457ea6 100644 --- a/zerver/tests/test_templates.py +++ b/zerver/tests/test_templates.py @@ -36,7 +36,7 @@ header

Heading

-

+