Skip to content

HTML-formatted strings are displayed as is #6059

Open

Description

@vashirov

Issue Description
After #5732 some strings that contain HTML tags are displayed as is, instead of being interpreted.
For example,
image

or
image

Package Version and Platform:

  • Platform: Fedora
  • Package and version: 389-ds-base-2.4.4-1.fc39.x86_64
  • Browser: any

Steps to Reproduce
Steps to reproduce the behavior:

  1. Create a new instance and stop it
  2. Navigate to WebUI
  3. Observe HTML tags in text messages

Expected results
Text should not contain visible HTML tags, instead they should be interpreted.

Activity

  1. mreynolds389 commented on Nov 20, 2024

    @mreynolds389
    Contributor

    This code could be a solution:

    diff --git a/src/cockpit/389-console/src/lib/replication/replModals.jsx b/src/cockpit/389-console/src/lib/replication/replModals.jsx
    index 4890c0e5d..05ce4d140 100644
    --- a/src/cockpit/389-console/src/lib/replication/replModals.jsx
    +++ b/src/cockpit/389-console/src/lib/replication/replModals.jsx
    @@ -31,7 +31,12 @@ import {
     import PropTypes from "prop-types";
     import { ExclamationTriangleIcon } from '@patternfly/react-icons/dist/js/icons/exclamation-triangle-icon';
     
    -const _ = cockpit.gettext;
    +const _l = cockpit.gettext;
    +
    +function _(value) {
    +    const lvalue = _l(value);
    +    return <div dangerouslySetInnerHTML={{ __html: lvalue }} />;
    +}
     
     export class WinsyncAgmtModal extends React.Component {
         constructor(props) {
    @@ -329,7 +334,7 @@ export class WinsyncAgmtModal extends React.Component {
                 scheduleRow = "";
             }
     
    -        title = cockpit.format(_("$0 Winsync Agreement"), title);
    +        title = cockpit.format(_l("$0 Winsync Agreement"), title);
     
             return (
                 <Modal
    @@ -1104,7 +1109,7 @@ export class ReplAgmtModal extends React.Component {
                 bootstrapRow = "";
             }
     
    -        title = cockpit.format(_("$0 Replication Agreement"), title);
    +        title = cockpit.format(_l("$0 Replication Agreement"), title);
             return (
                 <Modal
                     variant={ModalVariant.medium}
    
  2. mirielka commented on Apr 15, 2025

    @mirielka
    Contributor

    Same issue when clicking "Generate report", the dialog has broken formatting as well

    Image

  3. added
    cockpitCockpit UI Plugin
    priority_mediumgood value but complex/risky/not crucial
    and removed
    needs triageThe issue will be triaged during scrum
    on Jun 4, 2025
  4. added this to the 3.2 milestone on Jun 4, 2025
  5. modified the milestones: 3.2, 3.3 on Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cockpitCockpit UI Pluginpriority_mediumgood value but complex/risky/not crucial

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions