Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs

Dashboard
Notifications
Mark all as read
Q&A

Welcome to Codidact Meta!

Codidact Meta is the meta-discussion site for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.

Although div tag is not allowed, it's rendered in the preview

+5
−0

tl;dr

According to this post, the div tag is not allowed, thus it's removed from posts. But it's not removed from the preview, and I believe both (the preview and the final saved post) should be consistent between each other.


I've made this test on the dev server, using HTML that contains a div.

In the post editor, I've used this HTML:

<div dir="rtl">abc...</div>

I'm using dir="rtl" because it gives a good visual hint that the div is there, as we can see in the images below.


In the preview, the div is rendered:

div is rendered in the preview

We can see the div is there in the preview, by checking the browser's console, and also by noting that dir="rtl" was applied (text is using right-to-left direction).


But when I save the post, the div is removed:

div is removed from the saved post

We can see that by checking the browser's console, and also noting that right-to-left is no longer being applied (which confirms that the tag was removed).


This is not a feature request to add support for div. It's a bug report about the inconsistency between the preview and the final rendered post. If a tag is removed from the saved post, the preview should remove it as well.

I believe that both should render everything the same way, whenever it's possible. This avoid situations where an user thinks their HTML will work, but will find out it doesn't work only after saving the post.


PS: I've also tested with kbd and the same happens (it's rendered in the preview, and removed after saving the post). I haven't tested with other tags.

Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

We don't support `div`.. (2 comments)

0 answers

Sign up to answer this question »

This community is part of the Codidact network. We have other communities too — take a look!

You can also join us in chat!

Want to advertise this community? Use our templates!