HTML editor needs to keep comments

0 Likes
(3)

In Canvas I can switch to the HTML editor but if I add a comment <!-- the words within the comment --> and the comment code get deleted when I switch back to Rich text. It would be nice to have material commented out so that students can't see but still have it there so I don't have to re-create it each time. 

I thought I would be the only who would like this feature but I just had another teacher frustrated because she was commenting our Wednesday - Friday's instructions and links and yet when she saves and goes back to the HTML editor the comment and everything inside is gone. 

5 Comments
Allie_Dilts
Instructure
Instructure
Status changed to: Open

Hi @FortCaAdmin

Thanks for your idea submission! I've opened your idea for conversation. 

While HTML comments are not a supported feature in the HTML Editor (according to this document), you can also view other conversations about improving the HTML Editor in this idea conversation.

Thanks, 

Allie

profesaalfeld
Community Member

I am the frustrated teacher. I want to be able to post content on a page for the week when I'm doing my prep but show only the current day's content. But when I used <!--xyz--> to hide the content for the rest of the week, it disappeared as soon as I hit save. As an alternative I created an unpublished page where I put all of my content so I can copy and paste. But it is a huge pain to copy and paste every day.

I tested it to see if this HTML editor will save my comments when I hit save and it does. Could you please make this happen in the Canvas HTML editor as well?

James
Community Champion

@FortCaAdmin , @profesaalfeld 

HTML comments do not completely hide content from the determined student, they can view the HTML on the page and see it. Make sure that you're not putting sensitive information into the page.

Since you're already going into the HTML editor, there is another solution that works and doesn't get stripped out like the HTML comments.

Wrap your content to be hidden in a div element that has a style of display="none".

This is an over simplification of the content on your page, but all that will show to the students will be Monday and Tuesday. 

<p>This is Monday's assignment</p>
<p>This is Tuesday's assignment</p>
<div style="display: none;">
<p>This is Wednesday's assignment</p>
<p>This is Thursday's assignment</p>
</div>

Later in the week, you can edit the HTML and move the div line down to show more. You can also apply the style to individual elements if you don't need to apply it to an entire block.

Content with display="none" will not be read to people using screen readers.

Of course, the content will still be visible to students who view the source of the page.

profesaalfeld
Community Member

Thank you! That works great!

ProductPanda
Instructure
Instructure
Status changed to: Archived
Comments from Instructure

As part of the new Ideas & Themes process, all ideas in Idea Conversations were reviewed by the Product Team. Any Idea that was associated with an identified theme was moved to the new Idea & Themes space. Any Idea that was not part of the move is being marked as Archived. This will preserve the history of the conversations while also letting Community members know that Instructure will not explore the request at this time.