Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linebreak and text vanish in HTML label #55532

Closed
2 tasks done
kannes opened this issue Dec 6, 2023 · 1 comment · Fixed by #56334
Closed
2 tasks done

Linebreak and text vanish in HTML label #55532

kannes opened this issue Dec 6, 2023 · 1 comment · Fixed by #56334
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Labeling Related to QGIS map labeling

Comments

@kannes
Copy link
Contributor

kannes commented Dec 6, 2023

What is the bug or the crash?

I tried to create some fancy labels for a vector layer with HTML formatting but some parts are not displayed, parts of my text are vanishing.

On the left is my label expression editor open, you can see the intended rendering in the preview.
On the right is one such label in a map canvas.

image

Steps to reproduce the issue

  1. Use this as a label for a layer: foo<br>bar<span style="color:red">baz</span>
  2. Enable HTML rendering for the label
  3. Look at such label in the map, it reads "foo baz" with "baz" shown in red, "bar" is not shown although space seems reserved for it

Versions

<style type="text/css"> p, li { white-space: pre-wrap; } </style>
QGIS-Version 3.34.0-Prizren QGIS-Codezweig Release 3.34
Qt-Version 5.15.11
Python-Version 3.11.5
GDAL-Version 3.7.3
PROJ-Version 9.3.0
EPSG-Registraturdatenbankversion v10.094 (2023-08-08)
GEOS-Version 3.12.0-CAPI-1.18.0
Kompiliert mit SQLite 3.44.0 Läuft mit SQLite 3.44.2
Gegen PDAL kompiliert 2.6.0 Läuft mit PDAL 2.6.1
PostgreSQL-Client-Version 16.0
SpatiaLite-Version 5.1.0
QWT-Version 6.2.0
QScintilla2-Version 2.14.1
BS-Version Manjaro Linux
       
Aktive Python-Erweiterungen
searchlayers 3.0.14
MetaSearch 0.3.6
db_manager 0.1.20
grassprovider 2.12.99
processing 2.12.99
QGIS-Version 3.34.0-Prizren QGIS-Codezweig [Release 3.34](https://github.com/qgis/QGIS/tree/release-3_34) Qt-Version 5.15.11 Python-Version 3.11.5 GDAL-Version 3.7.3 PROJ-Version 9.3.0 EPSG-Registraturdatenbankversion v10.094 (2023-08-08) GEOS-Version 3.12.0-CAPI-1.18.0 Kompiliert mit SQLite 3.44.0 Läuft mit SQLite 3.44.2 Gegen PDAL kompiliert 2.6.0 Läuft mit PDAL 2.6.1 PostgreSQL-Client-Version 16.0 SpatiaLite-Version 5.1.0 QWT-Version 6.2.0 QScintilla2-Version 2.14.1 BS-Version Manjaro Linux

Aktive Python-Erweiterungen
searchlayers
3.0.14
MetaSearch
0.3.6
db_manager
0.1.20
grassprovider
2.12.99
processing
2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

If I use <p></p> instead of a <br> or <br />, it looks as intended.

@kannes kannes added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Dec 6, 2023
@agiudiceandrea agiudiceandrea added the Labeling Related to QGIS map labeling label Dec 12, 2023
@elpaso elpaso self-assigned this Feb 13, 2024
elpaso added a commit to elpaso/QGIS that referenced this issue Feb 13, 2024
Fix <br> ignored in HTML formatted labels.

Fix qgis#55532
elpaso added a commit to elpaso/QGIS that referenced this issue Feb 13, 2024
Fix <br> ignored in HTML formatted labels.

Fix qgis#55532
@kannes
Copy link
Contributor Author

kannes commented Feb 23, 2024

yay, thanks @elpaso

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Labeling Related to QGIS map labeling
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants