qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.5k stars 2.99k forks source link

Add support for colored strikeout in html labels #59048

Open cymed opened 1 week ago

cymed commented 1 week ago

What is the bug or the crash?

QGIS labeling supports HTML fomatting since 3.28. However, when trying to nest spans such as

'<span style="color:red;text-decoration:line-through">
  <span style="color:black">black text with red strikethrough</span>
</span>'

, only the color setting of the inner span is used.

Steps to reproduce the issue

Use the HTML code above to set a label

Versions

QGIS-Version | 3.34.11-Prizren | QGIS-Codeversion | 2904bcec -- | -- | -- | -- Qt-Version | 5.15.13 Python-Version | 3.12.6 GDAL-Version | 3.9.2 PROJ-Version | 9.4.0 EPSG-Registraturdatenbankversion | v11.004 (2024-02-24) GEOS-Version | 3.12.2-CAPI-1.18.2 SQLite-Version | 3.45.1 PDAL-Version | 2.6.3 PostgreSQL-Client-Version | 16.2 SpatiaLite-Version | 5.1.0 QWT-Version | 6.2.0 QScintilla2-Version | 2.14.1 BS-Version | Windows 11 Version 2009   |   |   |   Aktive Python-Erweiterungen AnotherDXF2Shape | 1.3.1 document_management_system | 0.3.3 linking_relation_editor | v1.4.0 plugin_reloader | 0.11 swiss_locator | 3.0.1 teksi_wastewater | 0.0.0 db_manager | 0.1.20 MetaSearch | 0.3.6 processing | 2.12.99 QGIS-Version 3.34.11-Prizren QGIS-Codeversion [2904bcec](https://github.com/qgis/QGIS/commit/2904bcec) Qt-Version 5.15.13 Python-Version 3.12.6 GDAL-Version 3.9.2 PROJ-Version 9.4.0 EPSG-Registraturdatenbankversion v11.004 (2024-02-24) GEOS-Version 3.12.2-CAPI-1.18.2 SQLite-Version 3.45.1 PDAL-Version 2.6.3 PostgreSQL-Client-Version 16.2 SpatiaLite-Version 5.1.0 QWT-Version 6.2.0 QScintilla2-Version 2.14.1 BS-Version Windows 11 Version 2009 Aktive Python-Erweiterungen db_manager 0.1.20 MetaSearch 0.3.6 processing 2.12.99 ### Supported QGIS version - [X] I'm running a supported QGIS version according to [the roadmap](https://www.qgis.org/en/site/getinvolved/development/roadmap.html#release-schedule). ### New profile - [ ] I tried with a new [QGIS profile](https://docs.qgis.org/latest/en/docs/user_manual/introduction/qgis_configuration.html#working-with-user-profiles) ### Additional context _No response_
nyalldawson commented 5 days ago

Nested spans are already supported, but different text/strikeout color is not.