Skip to main content

We need to do some HTML edits to our articles, but anytime we edit the article via "Code" in the editor, the changes are not saved. How to save them? Thank you!

Hi & welcome to the inSpired community!

The editor currently automatically strips all manually added HTML from your post. This is, as far as I know, to prevent abuse. We do have plans to allow community team members to switch to a HTML view, in order to apply changes directly via code. This should enable you to further customize your content. 

As far as I remember, this improvement is planned to be worked on amongst other editor improvements in Q4 of this year, however this is not fully set in stone yet. I’d recommend you to subscribe to our news & platform updates category and wait for our next roadmap update to be published.

Could you explain a little bit more what you wanted to edit via HTML? This gives us a better idea of what you are trying to achieve and can be relevant for our research around editor improvements.

 


I’m not the author of the original post, but we’ve just come up against the same problem.

I think being able to add attributes into the html tags is very useful, for admins only of course,

Our use case is fairly simple - we want to be able to provide links with  #fragment at the end of the URL. It would then scroll the page down to that part of the page. It’s particularly useful for long FAQ’s etc. It’s really no different to providing a link to a particular reply on a thread.

However, in the code view of the editor in Control, attributes are stripped out upon saving. so e.g. we tried added an id to a regular p tag, with the view to having a url: oursite.com/our-faq#section_one

Original html was;
<p>Interesting section</p>

we tried to changed it to
<p id="section_one">Interesting section</a>

But it just reverted back so we can’t provide links to different parts of the page like that and we really need to. We tried adding a different tag (which would have the same effect)

<a name="section_one"></a>

but that caused the whole content to be lost upon saving

Another use case would be to add a css class to an element, so it could be specially styled with the custom CSS.

I think all html attributes would be relatively harmless, apart from onClick, onHover etc - so anything that would induce javascript basically.


Hi there @Alo !

The best workaround I can think of, would be using the link feature in the new editor to do something like this:

Where possible, it’s actually best to disallow raw HTML input for security reasons, because even Admins can’t always be trusted (I work in cybersecurity, so I’ve encountered this before). In actual fact, by restricting this sort of thing for everyone means that if a moderator’s account got compromised, the attacker wouldn’t be able to abuse the ability to input raw HTML

It’s also best to avoid using code directly when writing any posts/comments that are intended to be published on the community, including BBcode (which inSided has technically phased out). If you’re able to use the regular view in the editor, that should work fine for most things.


Thanks for your reply, but its the named anchor that I need to add in the article on the insided side, rather than linking out to a specific part of another webpage.

The 2 ways to achieve that are by having a standard anchor tag with the name attribute; <a name=”section_one”></a> or having an id attribute on any html tag, like <p id=”section_one”>dasfdfd</p>

I’m not suggesting using any custom code or html - I would consider this a core backbone of what html is for - being able to link to other webpages, and to a particular section of another webpage. I can’t think of any security implications by allowing the standard ‘id’ or ‘name’ attribute to be applied on standard html tags?


Gotcha, thanks @Alo !

That might be possible using the editor itself actually. It’s not currently supported, but there is an Idea open to enable Anchors to be an option in the editor directly, without using code view. If you’re verified as an inSided customer, you should be able to access this link.

The snag right now is the fact the tags get stripped out. I’ll see if @Julian knows anything about that, as things might have changed since he responded.


Reply