News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Custom BBCode content and output are escaped

Started by Prodibi, April 15, 2018, 09:00:22 AM

Previous topic - Next topic

Prodibi

Hello, I wrote a simple mod to replace a BBCode by some HTML, but the input and output are escaped with " and  

I use this command

array(
'tag' => 'prodibi',
'type' => 'unparsed_content',
'content' =>'<div><script>document.currentScript.parentElement.setAttribute("data-prodibi",\'$1\'.replace(/&quot;/g, "\\"").trim())</script></div>'
);


the $1 variable is suppose to be some json input like { "width": 3590, "height": 5384, "heightMode": "aspectRatio", "id": "2ej1ko0dd7gddd" } but looks like
{ &quot;width&quot;: 3590, &quot;height&quot;: 5384, &quot;heightMode&quot;: "aspectRatio", &quot;id&quot;: &quot;2ej1ko0dd7gddd&quot; }

How can I get the raw content instead of the escaped one?

and when I set the 'content' with something like

'<div>
     <script />
</ div>'

it results in something like that that is not working

'<div>&nbsp;
&nbsp;&nbsp;<script&nbsp; />
</&nbsp;div>'


how can I output raw HTML?

Thank you by advance  :)

Advertisement: