Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 951829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:47:52+00:00 2026-05-15T23:47:52+00:00

I have a pre element with some html code in it. the code has

  • 0

I have a pre element with some html code in it.
the code has special characters in it, like <, so it doesn’t break the page.

Then I have a javascript function that gets the contents of this pre element, highlights it (with codemirror), and replaces the element contents with the highlighted text.

I’m using $("pre").append(...); to do this.
The problem is that after the highlighting, on the screen I see &lt; instead of <.
How can I convert these characters back to html?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:47:53+00:00Added an answer on May 15, 2026 at 11:47 pm

    You should be using the .text() method to grab the code from the pre. This way you are’t giving the encoded symbols to the code highlighter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code that adds a pre-determined HTML snippet into a pre-determined <div> element
I have a HTML code like this: <pre><div class=post style=border-width:1px;border-style:solid> <div class=userpic style=width:70px;float:left> <img
I'm using pre element to display some text including special unicode characters (⚡ ⚑
I have some code in a pre element in a UIWebView on iphone, so
I have a mystery.html page that loads some javascript (as well as mootools). I
I have a content editable div. Within this I am inserting a <pre>some code</pre>
I have a pre tag within my page that contains quite a bit of
I could understood that Desktop applications in Java doesn't have a pre-defined relative path
I have a project that comprises pre-build Dll modules, built some time in the
I have an issue when rendering templated items within a ul with some pre-defined

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.