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
0
votes
1 answer

Why isn't Google Code Prettify working on css?

I'm using prettify.js for some blog posts. It's handling my html, python, and js fine, but missing the css. My html is:
`

    .my-boxclass {
        display: inline-block;
        position: relative;
       …
singmotor
  • 3,930
  • 12
  • 45
  • 79
0
votes
1 answer

JS, HTML. Google prettify. How to insert prettified html code into contenteditable div in html page dynamically

I am writing a messenger and my aim is to add an opportunity to insert code and highlight it as it is done on Stack Overflow. I am using prettify library by Google. Here is html part:
Andrey
  • 45
  • 1
  • 7
0
votes
1 answer

Prettify prettyPrint() function not loading inside Somewhere inside body tag I have:

        
galah92
  • 3,621
  • 2
  • 29
  • 55

0
votes
1 answer

Highlight some lines with google code-prettify

How can I highlight some lines with google code-prettify? Like on Github.
user6029868
0
votes
2 answers

How do I remove `` from `
` with javascript?

The triple backticks in markdown render as
...
. More specifically, # in markdown ```java ``` # render as

...

# my expecting result (for Google code prettify):
SparkAndShine
  • 17,001
  • 22
  • 90
  • 134
0
votes
1 answer

prettyPrint() function does not work after a page is loaded

I am using google-code-prettify through CDN as mentioned in faq over here prettyPrint() is the function which highlights code. Now i am having…
Skyyy
  • 1,539
  • 2
  • 23
  • 60
0
votes
2 answers

Prettify Custom Theme Code does not fit

On certain browsers (Firefox, in this case), the size of a given font is different, which prompted me to download a copy of a theme (desert) from the Google Code page and tweak it myself since the theme had a different background color from my…
Andrew Fan
  • 1,313
  • 5
  • 17
  • 29
0
votes
1 answer

Javascript prettyPrint an external java file

I'm really new to web development and I'm kind of lost here. I'm using Bootstrap, and I'm trying to display java code (in a file called test.java) that's on my local machine on the webpage. The file is displayed, but it doesn't get syntax coloured.…
0
votes
1 answer

Postach.io and google-code-prettify

Is there a way to use markdown and google-code-prettify library to use together to pretify the my code? I have been using ``` var s = "hello world!"; ``` which produces
 
HTML markup. But I am unable to add the…
nilgun
  • 10,460
  • 4
  • 46
  • 57
0
votes
0 answers

Object.prototype.myFunction breaks "prettify"

Google prettify stops working when my JS file has a Object.prototype.myFunction = function(.... I.e. when I have at least one new function defined inside the Object.prototype, It prevents prettify to show code on my web-page. Even though, I don't…
ses
  • 13,174
  • 31
  • 123
  • 226
0
votes
2 answers

ReferenceError: prettyPrint is not defined error

Hope you can help me with ReferenceError: prettyPrint is not defined. How do I contact you? One moment...