Skip to content

Ferris gets ugly background when hovered over on short code snippets #4529

@NeatNit

Description

@NeatNit

Most of the text of this post is irrelevant. The screenshots are still relevant though. See #4529 (comment) and future comments.

  • I have searched open and closed issues and pull requests for duplicates, using these search terms:
    • chapter 9.1
  • I HAVEN'T checked the latest main branch to see if this has already been fixed, because I don't know what to look for!

URL to the section(s) of the book with this problem: https://doc.rust-lang.org/book/ch09-01-unrecoverable-errors-with-panic.html

Description of the problem:
The first code example is rendered strangely in Chapter 9.1:

Image

Note the buttons on the top-right. Ferris has somehow become one of the buttons!

The second example on that page is rendered more normally:

Image

The HTML in the DOM for the broken example is:

<pre class="playground">
    <div class="buttons">
        <button class="clip-button" title="Copy to clipboard" aria-label="Copy to clipboard"><i class="tooltiptext"></i></button>
        <button class="fa fa-play play-button" hidden="" title="Run this code" aria-label="Run this code"></button>
        <a href="ch00-00-introduction.html#ferris" target="_blank">
            <img src="img/ferris/panics.svg" title="This code panics!" class="ferris ferris-small">
        </a>
    </div>
    <!-- ... -->
</pre>

And the working example is:

<pre class="playground">
    <div class="buttons">
        <button class="clip-button" title="Copy to clipboard" aria-label="Copy to clipboard"><i class="tooltiptext"></i></button>
        <button class="fa fa-play play-button" hidden="" title="Run this code" aria-label="Run this code"></button>
    </div>
    <div class="ferris-container">
        <a href="ch00-00-introduction.html#ferris" target="_blank">
            <img src="img/ferris/panics.svg" title="This code panics!" class="ferris ferris-large">
        </a>
    </div>
    <!-- ... -->
</pre>

Suggested fix:
Find and fix the JavaScript bug that's rendering the first box incorrectly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions