N°3918 - Fix wiki syntax "[[CLASS:ID]]" not working in logs

This commit is contained in:
Molkobain
2021-08-12 17:28:50 +02:00
parent 095c975ec6
commit 7af10e5197
2 changed files with 13 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ namespace Combodo\iTop\Application\TwigBase\Twig;
use AttributeDateTime;
use AttributeText;
use Combodo\iTop\Application\UI\Base\iUIBlock;
use Combodo\iTop\Renderer\BlockRenderer;
use Dict;
@@ -98,6 +99,17 @@ class Extension
})
);
/**
* Filter to transform the wiki syntax into HTML
*
* @uses \AttributeText::RenderWikiHtml()
* @since 3.0.0
*/
$oTwigEnv->addFilter(new Twig_SimpleFilter('render_wiki_to_html', function ($sString) {
return AttributeText::RenderWikiHtml($sString);
})
);
// Filter to add a parameter at the end of the URL to force cache invalidation after an upgrade.
// Previously we put the iTop version but now it's the last setup/toolkit timestamp to avoid cache issues when building several times the same version during tests
//

View File

@@ -28,7 +28,7 @@
<div class="ibo-activity-entry--main-information-content" data-role="ibo-activity-entry--main-information-content">
{% block iboActivityEntryMainInformationContent %}
{# Content is printed as raw because it is stored as HTML in the database and should have been sanitized before storage, so we can assume it is safe #}
{{ oUIBlock.GetContent()|raw }}
{{ oUIBlock.GetContent()|render_wiki_to_html|raw }}
{% endblock %}
</div>
</div>