REST API. Getting error during posting new message
Hello guys,
I get the following error when I'm try to post new message on a board via Lithium REST API:
message.body: Your post has been changed because invalid HTML was found in the message body. The invalid HTML has been removed. Please review the message and submit the message when you are satisfied.
My orginal text is the following:
<p><p class="bold">Text of description.</p></p><p>Text of description.</p><p><p class="italic">Text of description.</p></p><p>Text of description.</p><p><p class="underline">Text of description.</p></p><p>Text of description.</p><p><p>Text of description.</p></p>
As far as I remember Lithium has the following constraints on using HTML code:
basicHTMLTags = br,p:class,a:href|target|rel|title,div,li-video:vid|align|size|width|height|originalwidth|originalheight|thumbnail|uploading|external|cid|pid|unm,li-spoiler
simpleHTMLTags = a:href|target|rel|title,b,i,p:align|class,u,br,em,hr,ol,li,ul,pre,div:align|class,img:src|width|height|alt|title|border|align,font:face|size|color,span:class,span:style,center,strike,strong,blockquote:dir,li-video:vid|align|size|width|height|originalwidth|originalheight|thumbnail|uploading|external|cid|pid|unm,table:cellspacing|cellpadding|border,tr,td,li-spoiler
superSimpleHTMLTags = a:href|target|rel|title,b,i,p:align|class,u,br,em,hr,ol,li,ul,pre,div:align|class,font:face|size|color,span:class,center,strike,strong,blockquote:dir,li-video:vid|align|size|width|height|originalwidth|originalheight|thumbnail|uploading|external|cid|pid|unm,li-spoiler
As you can see my original text is fully matched basicHTMLTags.
So I don't understand why this wired error is occurred. Could anyone can explain me?
iahiqosolutions wrote:
Hello AllenS,
The HTML code that you suggested is working perfectly well,
but there is a moment which is not clear for me:
How can I switch HTML set that is currently used by Lithium(superSimpleHTMLTags, simpleHTMLTags, basicHTMLTags)?Can I create my own HTML tag set?(for example, I want to allow to use each user tag "img")
Hi iahiqosolutions,
I'm glad to hear that worked out!
Changing which tags the HTML parser allows is something the Lithium team will have to adjust for you on the backend. If you file a support case with the changes you would like to make we can go ahead and set that up on stage for you to review. You can submit a support case by accessing the Lithium support portal on the Lithosphere or by e-mailing support@lithium.com directly.
Have a great day!