Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FIXED] Italic and other HTML formatting not rendered in titles #468

@stalkerGH

Description

@stalkerGH

System information

Zola version: 0.19.2
tabi version: 3.1.0

Expected behaviour

I'd like to have HTML formatting like italic or bold in titles. I couldn't add HTML formatting to page titles and card list titles. I described my efforts in Zola Discourse thread: https://zola.discourse.group/t/is-it-possible-to-use-html-in-title-variable/1651/6

Actual behaviour

But I found the simple solution by adding safe filter to templates/page.html and partials/cards_pages.html. Because I can't attach my diffs, I give them below.

page.html
@@ -110 +111 @@
- {{ page.title }}
+ {{ page.title | safe }}

card_pages.html

@@ -29,7 +40,6 @@
- <div class="card-info">
- <h2 class="card-title">{{ page.title }}</h2>
- <div class="card-description">
- {% if page.description %}
- {{ page.description }}
- {% endif %}
- </div>
+ <div class="card-info">
+ <h2 class="card-title">{{ page.title | safe }}</h2>
+ <div class="card-description">
+ {% if page.description %}
+ {{ page.description | safe }}
+ {% endif %}

Steps to reproduce

.

Additional context

I attach the .diff files as .txt

page.txt
cards_pages.txt

Final checklist

  • I've checked that the issue isn't already reported.
  • I've tested with the latest version of tabi to check if the issue has already been fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions