Report any technical problems you discover and discuss solutions.

Displaying text as 'code'

  • ymoore
  • Topic Author
  • Offline
  • Administrator
  • Administrator
More
8 years 2 months ago #5091 by ymoore
Displaying text as 'code' was created by ymoore
Hi

I'm trying to display some HTML code (as an example for others to use)in my LO but when published the code is being displayed as web content (i.e. it interprets the HTML rather than displaying as pure text). I've tried using the code format style from the text editor, and using <code> tags in the HTML view but can't get it to work. Any suggestions?

Thanks

Yvonne

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago #5100 by ronm
Replied by ronm on topic Displaying text as 'code'
Hi Yvonne
try any of the following:
Code:
<xmp>Wrap your code between </xmp> tags. Or put your code inside <textarea></textarea> tags. Or Convert all your ‘<‘ and ‘>’ to ‘&lt’ and ‘&gt’ respectively

HTH
Ron

Xerte developer & trainer
e-learning & m-learning consultant
mitchellmedia.co.uk | xerteacademy.com | learningapps.co.uk
Note: Support here is voluntary and meant for users to support each other.
Need direct commercial support with Xerte? mitchellmedia.co.uk/contact/
The following user(s) said Thank You: ymoore

Please Log in or Create an account to join the conversation.

Moderators: ronmjultenJohnSmith
Time to create page: 0.187 seconds
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo