I'm using HTMLPurifier and even thou I have :
$config->set('HTML.Doctype', 'XHTML 1.0 Transitional');
it removes all 'target' attribues from the links.
Any idea why is it doing it?
I'm using HTMLPurifier and even thou I have :
$config->set('HTML.Doctype', 'XHTML 1.0 Transitional');
it removes all 'target' attribues from the links.
Any idea why is it doing it?
The list of allowed frame targets is not enabled by default. You have to enable it manually.
In a Yii2 application, inside of a DetailView, I configured HtmlPurifier as follows:
[
'label' => 'Document PDF',
'format'=> 'raw',
'value' => HtmlPurifier::process(DocumentFunctions::viewDocumentPdfInView($model->document_id), [
'Attr.AllowedFrameTargets' => ['_blank'],
]),
],
Here is a simpler way I found:
[
'label' => 'Document PDF',
'format'=> ['html', 'config' => ['Attr.AllowedFrameTargets' => ['_blank']]],
'value' => DocumentFunctions::viewDocumentPdfInView($model->document_id),
]
© 2022 - 2024 — McMap. All rights reserved.