Fix code samples rendering as raw HTML in locators and IE docs - #2783
Fix code samples rendering as raw HTML in locators and IE docs#2783tag-und-nacht wants to merge 2 commits into
Conversation
The Java tabs on the locator strategies page were missing `text=true`, so Docsy's `tabpane` shortcode sent the `gh-codeblock` output through `highlight` instead of emitting it as-is. Because `gh-codeblock` already returns HTML, the toolbar div, `<style>` block, modal markup and `<script>` body were all escaped and displayed as if they were Java source. Adds the missing `text=true` to the 8 affected tabs in each of the four translations. The other bindings on the page already had it.
In the ja, pt-br and zh-cn Internet Explorer pages, `badge-examples` sat inside the Kotlin tab rather than directly after the `tabpane` opener. That tab renders as code, so the badge's HTML was escaped and printed above the Kotlin snippet. Moves the shortcode to the position it already has in the English page.
👷 Deploy request for selenium-dev pending review.Visit the deploys page to approve it
|
PR Summary by QodoFix escaped shortcode HTML in locator and IE documentation tabs
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can start a comment with 'qodo' or '@qodo' to chat about any finding |
Description
Two rendering bugs where a shortcode's HTML output ended up escaped and displayed as source inside a code tab.
1. Java samples on the locator strategies page (all 4 languages)
Docsy's
tabpaneshortcode has two modes: withtext=trueit emits the tab body as-is, without it the body goes throughhighlight. The Java tabs on this page were missingtext=true, butgh-codeblockalready returns HTML — so its toolbar<div>,<style>block, modal markup and entire<script>body were escaped and shown as if they were Java source. A reader looking fordriver.findElement(By.className("information"))gets ~100 lines of HTML and JavaScript instead.8 tabs per file, in
locators.{en,ja,pt-br,zh-cn}.md. The other bindings on the page already hadtext=true.2. Misplaced
badge-exampleson the translated Internet Explorer pagesIn
internet_explorer.{ja,pt-br,zh-cn}.mdthebadge-examplesshortcode sat inside the Kotlin tab instead of directly after thetabpaneopener, so the badge's HTML was escaped and printed above the Kotlin snippet. Moved to the position it already has ininternet_explorer.en.md.Motivation and Context
Both are visible on the live site today:
/documentation/webdriver/elements/locators/(en, ja, pt-br, zh-cn)/{ja,pt-br,zh-cn}/documentation/webdriver/browsers/internet_explorer/Types of changes
Checklist
Verification
Built the full site locally with
SELENIUM_CI_TOKENset and scanned all 2,343 generated HTML pages for escaped shortcode markup — stripping the highlighter's<span>wrappers first, since they split the escaped text and defeat a plain grep. Signatures checked: thegh-codeblocktoolbar div, its "View on GitHub" div, its<style>block, nestedhighlightdivs, theSELENIUM_CI_TOKENalert, andselenium-badgespans. Zero hits after the change; the locators page went from 72 escaped<divto 0 and now emits a real<pre><code class="language-java">.Scope note: a scan of all 8,289 tab blocks across
website_and_docs/contentfound no other tab invoking a shortcode withouttext=true. The remaining ~1,310 non-texttabs are correct as they are — they hold literal inline code thathighlightis supposed to colour, and addingtext=trueto those would break them.