Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Post status on Facebook containing HTML tags using javascript SDK

I already tried all the answers from this question.

I'm trying to post status on Facebook page using JavaScript SDK and it's working fine for me. But I'm facing some strange problem which is whenever I tried to insert a new line or tried to underline a text then on Facebook it's displaying html tag there.

e.g:

I've tried <center></center> it didn't work. I've tried <br> it didn't work. I've tried with invisible html characters, it didn't work. I've tried with '\n'it didn't work. I even used "\n".

The Angular bracket (<) is replace by &lt;

Update

On Facebook side the status looks like this.

<p>I've tried &lt;center&gt;&lt;/center&gt; it didn't work. I've tried &lt;br&gt; it didn't work. I've tried with invisible html characters, it didn't work. I've tried with '\n' it didn't work.&lt;br/&gt;&lt;br/&gt;However when I used "\n" instead of '\n' it still not worked for me.&lt;br/&gt;&lt;br/&gt;Put &lt;center&gt;&amp;nbsp;&lt;/center&gt; for you need than one &lt;br /&gt; sadasdasd asd asd asdasd</p>

Inside the <p> tag all the brackets has been changed.

e.g: this (<) will be changed to &lt; and this (>) will be changed to &gt;

Question

Is there any way we can use html tags inside Facebook post or is there any way in which enter new line in Facebook post updated using JavaScript SDK.

like image 921
Ace Avatar asked Dec 11 '25 19:12

Ace


1 Answers

Simply put, Facebook posts can't contain any HTML.

like image 134
Björn Kaiser Avatar answered Dec 13 '25 08:12

Björn Kaiser