Hello--reviving this thread as I'm having some related issues using <pre> and <code>. Specifically, when I use these in the text of an Assignment, the result is beautifully formatted. But, when I view the Assignment as Test Student (or when one of my students views it), the formatting is substantially lost. Most alarming, code that should be presented across several lines is presented on a single line, even though the <pre> tag should preserve line breaks.
Interestingly, this does not happen with Pages (the formatting is fine for both instructor and student).
My suspicion is that something in the JavaScript/AJAX code that presents an Assignment to a student is stripping out all linebreaks, so that the content of the <pre> element is 'corrupted' by the time it's rendered as HTML. (My local Canvas gurus think this a reasonable suspicion, though none of us are certain.)
I'm very new to Canvas, though, so I hope I'm missing something! Can anyone offer guidance and/or a workaround? Thank you!
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.