Skip to content

Double HTML encoding in Project "details" field #3789

Description

@asidonia

What is your set up?

Cloud Hosted

Version

3.8.0

Describe the issue

Describe the Bug

The "What are you trying to achieve?" (details) field in the Project settings suffers from a double HTML encoding issue. When saving rich text, the WYSIWYG editor wraps it in HTML tags. However, the Blade templates for these views are using {{ htmlentities(...) }}, which double-escapes the HTML.

When the editor is re-loaded or the view is rendered, the HTML tags (like <p>) are displayed as plain text to the user instead of being rendered as rich text.

Expected Behavior

The rich text editor should render the HTML correctly without exposing the raw HTML tags to the user.

Root Cause & Proposed Fix

The issue is located in the Blade templates where the details field is printed. The {{ }} syntax in Blade already escapes data, so wrapping it in htmlentities() causes the double escape.

Files affected:

  1. app/Domain/Projects/Templates/submodules/projectDetails.blade.php
  2. app/Domain/Projects/Templates/newProject.blade.php

Current code:
<textarea ...>{{ htmlentities($project['details']) }}</textarea>

Proposed fix:
Replace with the unescaped Blade syntax so TipTap can initialize the HTML properly:
<textarea ...>{!! $project['details'] !!}</textarea>

Environment

  • Leantime Version: 3.8.0 (also tested/present in latest)
  • Installation Method: Docker

Para su conocimiento, este contenido, así como la propuesta de solución del bug se ha llevado a cabo con ayuda de IA.

Reproduction steps

  1. Go to Project Settings -> Create a new project or edit an existing one.
  2. Type some text in the "What are you trying to achieve?" field (e.g., "Hello").
  3. Save the project.
  4. Edit the project again.
  5. The text in the editor now visually shows <p>Hello</p> instead of rendering it.

Error Logs (LEANTIMEFOLDER/storage/logs)

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions