Plugin Detail Page Title Displays HTML Instead of Plugin Name #11106

Closed
opened 2025-12-29 21:40:23 +01:00 by adam · 3 comments
Owner

Originally created by @pheus on GitHub (Apr 30, 2025).

Originally assigned to: @jeremystretch on GitHub.

Deployment Type

Self-hosted

NetBox Version

main (commit 68e9da5cd9802eb78927a11b97330fd73ad81a2e)

Python Version

3.10

Steps to Reproduce

  1. Log in to the NetBox UI.
  2. Navigate to Admin > Plugins.
  3. Click on any plugin listed to view its detail page.
  4. Observe the browser tab's title (the <title> tag content).

Expected Behavior

The page title should display only the plugin's name, e.g., Example Plugin | NetBox.

Observed Behavior

The page title contains raw HTML code:
<img class="plugin-icon" src="https://plugins-assets.netbox.oss.netboxlabs.com/icons/default.svg"> Example Plugin | NetBox

This results in the <img> tag being displayed as literal text in the browser tab title, which is not expected.

Image

Additional Information:

  • This issue appears to be a regression introduced by PR #19333.
Originally created by @pheus on GitHub (Apr 30, 2025). Originally assigned to: @jeremystretch on GitHub. ### Deployment Type Self-hosted ### NetBox Version main (commit `68e9da5cd9802eb78927a11b97330fd73ad81a2e`) ### Python Version 3.10 ### Steps to Reproduce 1. Log in to the NetBox UI. 2. Navigate to **Admin > Plugins**. 3. Click on any plugin listed to view its detail page. 4. Observe the browser tab's title (the `<title>` tag content). ### Expected Behavior The page title should display only the plugin's name, e.g., `Example Plugin | NetBox`. ### Observed Behavior The page title contains raw HTML code: `<img class="plugin-icon" src="https://plugins-assets.netbox.oss.netboxlabs.com/icons/default.svg"> Example Plugin | NetBox` This results in the `<img>` tag being displayed as literal text in the browser tab title, which is not expected. <img width="614" alt="Image" src="https://github.com/user-attachments/assets/f2bf8b41-3ade-4e68-b2fe-8debda5b1490" /> **Additional Information**: - This issue appears to be a regression introduced by [PR #19333](https://github.com/netbox-community/netbox/pull/19333).
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:40:23 +01:00
adam closed this issue 2025-12-29 21:40:23 +01:00
Author
Owner

@pheus commented on GitHub (Apr 30, 2025):

From my understanding, the issue originates from line 7 in netbox/templates/core/plugin.html:

{% block title %}<img class="plugin-icon" src="{{ plugin.icon_url }}">&nbsp;{{ plugin.title_long }}{% endblock %}

The title Jinja block is used both for the page header (in the body) and for the <title> tag in the HTML <head>. As a result, including an <img> tag here causes it to appear literally in the browser tab title.

Apologies for not catching this earlier during PR code reading.

@pheus commented on GitHub (Apr 30, 2025): From my understanding, the issue originates from line **7** in `netbox/templates/core/plugin.html`: ```django {% block title %}<img class="plugin-icon" src="{{ plugin.icon_url }}">&nbsp;{{ plugin.title_long }}{% endblock %} ``` The `title` Jinja block is used both for the page header (in the body) and for the `<title>` tag in the HTML `<head>`. As a result, including an `<img>` tag here causes it to appear literally in the browser tab title. Apologies for not catching this earlier during PR code reading.
Author
Owner

@jnovinger commented on GitHub (Apr 30, 2025):

Doh, thanks for catching that, @pheus !

@jnovinger commented on GitHub (Apr 30, 2025): Doh, thanks for catching that, @pheus !
Author
Owner

@jeremystretch commented on GitHub (Apr 30, 2025):

Thanks for catching this @pheus!

@jeremystretch commented on GitHub (Apr 30, 2025): Thanks for catching this @pheus!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11106