Skip to content

Inform the user of disallowed HTML #1140

@MoshiKoi

Description

@MoshiKoi

There have been a lot of question on Discord and Meta about posts being different from what was shown in the preview. Currently, due to the way we handle submissions, differences between the post preview and the actual post comes from sanitization.

Could we have something that automatically detects when the sanitizer would remove content, and inform the user? We could do this either client-side or server side.

On the client side, we could have a script to detect when the preview contains disallowed tags and attributes, in accordance with https://meta.codidact.com/posts/277420. This would give live feedback, but could suffer from any discrepancies between the "client sanitizer" and the true sanitizer.

On the server side, we check that the submitted HTML is the same before and after sanitization, and if different, we would inform the users similar to how we inform the user when they are submitting an image without alt text. This would be accurate, but only catchable when the user hits the submit button.

Metadata

Metadata

Assignees

Labels

area: frontendChanges to front-end codecomplexity: unassessedNeeds further developer investigation before complexity/feasibility can be determined.priority: medium

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions