cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
danele_williams
Community Member

Why do my discussion posts lose format when I use HTML?

Jump to solution

When I post on a discussion board, I use a word document and then when I cut and paste, It won't let me paste as an option. Then I have to use the HTML,  and when it posts I lose all of the formats when I change it. How can I resolve this issue?

Dani

0 Kudos
1 Solution

Accepted Solutions
debra_mansperge
Community Contributor

Hi Dani,

I'm a little confused by your question, but I'll do my best to answer it.  I can create a document in Word and then paste it into a discussion, (using Ctrl-C and Ctrl-V on a PC) but it will strip out some of the formatting.  You can do some formatting with HTML, but Canvas also strips out some of that formatting, too.  If you really want the formatting, you have two options. 

1.You can upload the word file, then link to it in the discussion and put code in the link to have it automatically open using the document viewer (which may or may not display it correctly).  To do this, enter some text in the Rich content editor and link it to the file. How do I insert course files into the Rich Content Editor using the Content Selector as an instructo...  Then you need to open the HTML editor and add "auto_open" to the code.  Here is an example of some code that I used to have this file open automatically in a page - which should also work in a discussion: 

"<p style="text-align: center;"><span style="font-size: 14pt;"><a class="instructure_file_link instructure_scribd_file auto_open" title="F2018 CHM151LL Schedule Monday.pdf" href="https://learn.maricopa.edu/courses/1040673/files/52065103/download?wrap=1" data-api-endpoint="https://learn.maricopa.edu/api/v1/courses/1040673/files/52065103" data-api-returntype="File">Lab Schedule and Links to Handouts</a></span></p>"

You will probably need to adjust the size of it when you go back to the rich content editor.

2. There is some HTML formatting that Canvas allows and you might be able to use it to do what you want.  The allowed HTML tags and attributes can be found here. Rich Content Editor HTML Cheatsheet 

I hope this helps!

View solution in original post

2 Replies
debra_mansperge
Community Contributor

Hi Dani,

I'm a little confused by your question, but I'll do my best to answer it.  I can create a document in Word and then paste it into a discussion, (using Ctrl-C and Ctrl-V on a PC) but it will strip out some of the formatting.  You can do some formatting with HTML, but Canvas also strips out some of that formatting, too.  If you really want the formatting, you have two options. 

1.You can upload the word file, then link to it in the discussion and put code in the link to have it automatically open using the document viewer (which may or may not display it correctly).  To do this, enter some text in the Rich content editor and link it to the file. How do I insert course files into the Rich Content Editor using the Content Selector as an instructo...  Then you need to open the HTML editor and add "auto_open" to the code.  Here is an example of some code that I used to have this file open automatically in a page - which should also work in a discussion: 

"<p style="text-align: center;"><span style="font-size: 14pt;"><a class="instructure_file_link instructure_scribd_file auto_open" title="F2018 CHM151LL Schedule Monday.pdf" href="https://learn.maricopa.edu/courses/1040673/files/52065103/download?wrap=1" data-api-endpoint="https://learn.maricopa.edu/api/v1/courses/1040673/files/52065103" data-api-returntype="File">Lab Schedule and Links to Handouts</a></span></p>"

You will probably need to adjust the size of it when you go back to the rich content editor.

2. There is some HTML formatting that Canvas allows and you might be able to use it to do what you want.  The allowed HTML tags and attributes can be found here. Rich Content Editor HTML Cheatsheet 

I hope this helps!

View solution in original post

chofer
Community Coach
Community Coach

Hi danele.williamson...

I'm not one that really recommends pasting from MS Word documents into the RCE of Canvas.  In my experience, too much "junk" HTML code gets added to Canvas pages, and the formatting can become quite a headache to figure out.  However, I do understand why you'd want to compose your response "offline" (for instance, if you had recently been having internet issues and were worried that your responses wouldn't post correctly).  If you felt comfortable doing this, you could use site like https://htmltidy.net/ to clean up the HTML code prior to pasting your response into Canvas.  (There are other similar online tools like this available...this is just one option.)

 @debra_mansperge  is correct that only certain HTML tags are allowed inside of Canvas.  The allowable tags can be found in this PDF document.

I hope this will help, Dani.