Questions tagged [google-code-prettify]

Prettify is a JavaScript module and CSS file that allows syntax highlighting of source code snippets in an HTML page.

Google Code Prettify is a JavaScript module and CSS file that allows syntax highlighting of source code snippets in an HTML page.

Features

  • Works on HTML pages
  • Works even if code contains embedded links, line numbers, etc.
  • Simple API: Include some JavaScript code and CSS, and add an onload handler.
  • Lightweight: Small download and does not block page from loading while running.
  • Customizable styles via CSS. See the themes gallery
  • Supports all C-like, Bash-like, and XML-like languages. No need to specify the language
  • Extensible language handlers for other languages. You can specify the language.
  • Widely used with good cross-browser support.
103 questions
1
vote
1 answer

Why is Google Code Prettify rendering the actual code

I'm trying to display a html template as markup in a code block
        
            <%= template %>
        
    
But the template actually renders in the browser, rather than…
colmtuite
  • 4,311
  • 11
  • 45
  • 67
1
vote
2 answers

Google Code Prettify not working on HTML

I am using Google's code prettify to make code appear nicely on my website. It can be found here Google Code Prettify. It does not work for HTML. I know you are suppose to replace < with < and > with >. I have done this but the browser still…
Gary Holiday
  • 3,297
  • 3
  • 31
  • 72
1
vote
1 answer

Html code block for html snippet?

This has to be the most frustrating thing ever lol. I am using prettify.js to give the code syntax color, but with prettify.js or prism.js when I encode the html I have to write it like below with a period before .<, otherwise my syntax is messed…
Michael Joseph Aubry
  • 12,282
  • 16
  • 70
  • 135
1
vote
1 answer

Google Code Prettify Conflict with HTML

I am trying to use google-code-prettify to highlight the syntax of some code, but the browser is rendering the HTML I am including in the tags. I have followed the Getting Started instructions e.g.
propster
  • 527
  • 1
  • 5
  • 14
1
vote
1 answer

google-code-prettify removes text in angle bracket

I am using google-code-prettify to syntax-highlight CPP code. I used it as follows.

#include…
1
vote
1 answer

AngularJS: tabbing performance with Google Code Prettify

I've built a simple tabbed code viewer using Google Code Prettify in AngularJS but I'm having an issue with slow performance when clicking through the tabs (as well as when performing other actions). Here is the relevant plunker:…
damo-s
  • 1,008
  • 7
  • 16
1
vote
1 answer

Always black code with prettify on blogger

I have been trying to set up my blog to integrate code snippets. I tried prettify but it didn't really work. I have put