Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return html as is #23

Open
molster opened this issue Jan 29, 2019 · 1 comment
Open

Return html as is #23

molster opened this issue Jan 29, 2019 · 1 comment

Comments

@molster
Copy link

molster commented Jan 29, 2019

Hello, hoping im missing something simple here as this library is exactly what I was looking for.

So I have a "contentedable=true" div. This is a somewhat of a wysiwyg editor. When I want to preview, I cant just send text..as they have added various html tags. SO i pass it the html.. however it looks like this returns the html < > as encoded. Is there by chance an undocumented flag to have it not do this?

To give an exmaple: if I pass

temp = XBBCODE.process({ text: "<p>[b]hello im bold[/b]</p>", });

I get returned
"&lt;p&gt;<span class="xbbcode-b">hello im bold</span>&lt;/p&gt;"

I would expect to get returned
"<p><span class="xbbcode-b">hello im bold</span></p>"

on further reading, i see that it may be by design to prevent XSS, but as this is not an issue in this use case, a flag would be fantastic
{work around is of course to regex back all the <'s and such from their decoded forms, which is what im doing to hold me over}

@patorjk
Copy link
Owner

patorjk commented Jan 30, 2019

It's been a long time since I've used this project, I'm pretty sure that was done for XSS reasons like you said. It looks like the "process" function would just need to take a flag and if it was true, ignore lines 740 and 741. If I get a chance, I'll try and take a look at this tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants