How are we doing? Please help us improve Stack Overflow. Take our short survey

Questions tagged [prettify]

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

prettify
Filter by
Sorted by
Tagged with
0 votes
1 answer
146 views

eslint react to format curly braces

I can't find any react eslint rule to prettify the content between the curly braces <div> { items.map(i => (<div>{i}</div>)) } </div> It should ...
shinpei's user avatar
0 votes
1 answer
73 views

Python BeautifulSoup prettify

I am trying to web scrap a webpage to download the data. The code is as follow: from bs4 import BeautifulSoup import requests link='https://www.abs.gov.au/statistics/economy/price-indexes-and-...
ryantl's user avatar
  • 29
0 votes
1 answer
219 views

emacs prettify-symbols replacing characters at same point

I am using prettify-symbols to switch between the following words and shortcuts. The problem is that when the replacement is more than a single character, all letters are being inserted at the same ...
Dilna's user avatar
  • 395
0 votes
0 answers
648 views

How to run prettier automatically in Nuxt.JS

Using Nuxt.JS, while on development with npm run dev, I want to trigger the command npm run prettier automatically when saving, to keep the code clean. In any other project, I would achieve this with ...
adelriosantiago's user avatar
0 votes
1 answer
965 views

How to format SQL Queries inside PySpark codefile

I would like to format my existing SQL queries inside the PySpark file. This is how my existing source file looks like: from flow import flow f = flow(["xxx"], ["xxxxxxxx"]) # this ...
Anuj Sharma's user avatar
1 vote
1 answer
4k views

Prettify with BeautifulSoup using a formatter that will preserve &nbsp AND Cyrillic characters?

I'm generating some HTML with python and BeautifulSoup4. At the end, I'd like to prettify the generated HTML. If I prettify as follows: soup.prettify() BeautifulSoup converts all the &nbsp ...
bikz's user avatar
  • 495
0 votes
1 answer
433 views

BeautifulSoup prettify encoding non-English (Cyrillic) characters strangely

I have HTML with Cyrillic characters. I am using BeautifulSoup4 to process this. It works great, but when I go to prettify, it converts all the Cyrillic characters to something else. Here is a dummy ...
bikz's user avatar
  • 495
0 votes
1 answer
2k views

VS Code formatter for HTML emails

I'm looking for a code prettifier/formatter extension that will format HTML, specifically in the context of marketing emails. ALL of the existing products I've seen don't take MSO conditionals into ...
Paulo_dev's user avatar
0 votes
1 answer
404 views

Why is Sublime Text context menu disabled (image below)

I have installed HTML-CSS-JS Prettify package in Sublime Text 3 (on Ubuntu 18.4). The image below shows that it appears on the context menu. However, when I select its context menu (the second context ...
Andrew's user avatar
  • 149
0 votes
2 answers
48 views

How to merge code after prettify ran upstream

I'm maintaining a fork of an open source project where we pull approximately every month from upstream in order not to branch too much. When I tried to pull from upstream this month I found out they ...
Dan's user avatar
  • 261
4 votes
1 answer
889 views

How to prettify JSON.stringify() partially?

Users can download JSON files from our application, which I want to prettify for easier debugging than if all is in one line. However this increases the file size by nearly 40% even if the indentation ...
Konrad Höffner's user avatar
0 votes
1 answer
30 views

Google prettifier line slicing and white background

When I add line numbers with more than 4 digit numbers it's lines are sliced out of the code box. When I use background-color: #eee; all works great but it works not for white colour background-color:...
Ivan Shelonik's user avatar
0 votes
2 answers
921 views

JSON Prettifier Using Azure Function w/ PowerShell and HTTP Trigger

Thought this would be pretty simple, but alas, I can't figure it out. It appears that PowerShell will prettify JSON with a single cmdlet. Goal: Prettify JSON using a PowerShell Azure Function app ...
ericOnline's user avatar
  • 1,798
1 vote
1 answer
1k views

How to find an element that prettify doesn't show

I am trying to get the origin of this product with Beautifulsoup. I am trying to select the div in which the product data is ordered but I can't. Later I tried to obtain other div in the code, one of ...
Flor Pupi 's user avatar
-1 votes
1 answer
861 views

Drop javascript in html and auto-format all <code> and/or <pre> blocks

I am looking at this google prettify project: https://github.com/google/code-prettify In the usage section it says to use it like so: <pre class="prettyprint">class Voila { public: // Voila ...
Alexander Mills's user avatar
9 votes
1 answer
2k views

BeautifulSoup Prettify custom new line option

I'm using BeautifulSoup to build xml files. It seems like my two are options are 1) no formatting i.e. <root><level1><level2><field1>val1</field1><field2>val2</...
teebagz's user avatar
  • 704
0 votes
1 answer
127 views

Issues understanding Vim's regex engine

I am trying to set up a script for the conceal feature to prettify strings in Python. This worked fine so far for single word substitutions. But now I would like to replace "not in" with "∉". I tried ...
lo tolmencre's user avatar
  • 3,884
2 votes
0 answers
819 views

Python - CSS formatting lost when Beautifulsoup4 prettify() on a local .html file

I need to edit hundreds of .html files with beautifulSoup 4. My CSS formatting is lost when I write back the changes to file. Before prettify(): And prettify(): My code: from bs4 import ...
joke4me's user avatar
  • 832
3 votes
1 answer
932 views

Format html code in flask?

Is it possible to format html code before I render it with flask? In my current project, I use many jinja templates and everything is working, but the source code in the browser, doesn't look so good. ...
Keanu Hie's user avatar
  • 307
2 votes
1 answer
111 views

What is the state of the art approach for creating own rules for Google's Prettify?

What is the state of the art approach for creating own rules for Google's Prettify? I am not talking about changing the colors of existing rules, furthermore, I want to create new rules: e.g for ...
user avatar
0 votes
1 answer
1k views

Web Scraping with Beautiful Soup in Python - JavaScript Table

Im trying to scrape a table from a website but I cant seem to figure it out with Beautifulsoup in Python. Im not sure if its because of the table format, but I basically want to turn this table into a ...
Frank Drin's user avatar
  • 1,703
0 votes
3 answers
680 views

Python prettify create xml version

when I launch this code he generated xml file which contain xml version <\?xml version="1.0" ?>, I tried exclude this line using xml_declaration=False, but error appears: TypeError: prettify() ...
Oleg's user avatar
  • 11
0 votes
0 answers
281 views

Using google prettify in bootstrap website with php pages

I have a bootstrap website with css built in and am trying to implement google prettify as described on this tutorial: http://www.techinfected.net/2016/12/syntax-highlighting-with-code-prettify.html ...
Compoot's user avatar
  • 2,317
0 votes
1 answer
328 views

How can I run Prettify in a WPF WebBrowser to apply syntax highlighting?

I'm creating a WPF application that allows the user to enter text in a TextBox. This text may contain Markdown syntax, which is evaluated by a MarkdownDeep object to convert the text to HTML. I take ...
Mage Xy's user avatar
  • 1,803
0 votes
0 answers
215 views

Display a string as prettified HTML source code

I am working on an ASP.NET MVC web application. On one page, I have a string that looks as follows: <p> <i>This</i> is some <strong>text</strong>&nbsp;! </p>...
Tot Zam's user avatar
  • 8,556
2 votes
1 answer
240 views

Guidelines for Google Code Prettify [closed]

I'm hoping to pick up Issue 295 from Google's Code-Prettify project; i.e. to add support for lang-powershell. Whilst I've found some code examples, I can't find any documentation on how this code ...
JohnLBevan's user avatar
  • 23.6k
0 votes
1 answer
311 views

Android syntax highlighting using Java prettify, not showing (less than) < or <= sign in textview?

I am using java Prettify for syntax highlighting of java code in android app. I followed this example Android Syntax Highlighting? public class PrettifyHighlighter { private static final Map<...
Jitin Jassal's user avatar
1 vote
1 answer
288 views

How can I make prettify code work in one line?

I load prettify.js and format my code as such: x = a; y = b; It comes out all proper and pretty, but... I need to squeeze this code into an SQL column so it needs to be in one line without any ...
Arthur Tarasov's user avatar
2 votes
1 answer
2k views

'unicode' object has no attribute 'prettify'

I am using BeautifulSoup to parse an html article. I use some functions to clear the html, so I can keep only the main article. Also, I want to save the Soup Output to a file. The error I get is the ...
photeesh's user avatar
  • 312
0 votes
1 answer
795 views

prettify adding extra lines in xml

I'm using Prettify to make my XML file readable. I am adding some new info in to an excising XML file but when i save it to a file i get extra lines in between the lines. is there a way of removing ...
LeeEng's user avatar
  • 3
1 vote
0 answers
50 views

Android TextView SyntaxHighlighting

I know that the title is a duplicated question but I have no other choices as some threads here in StackOverflow are old. Anyway my question is, is there a code for android to highlight syntax? I've ...
David Diaz's user avatar
0 votes
1 answer
91 views

How to display properly formatted JS code snippets on a web page?

I am storing a JavaScript function in DB without spaces. Later I am retrieving from DB and showing on a Web page using google prettify but the code-snippet shows in a single line, var Pizza = ...
user2225263's user avatar
4 votes
3 answers
6k views

How to beautify/prettify a Json/JS file in a node.js script

I am searching a way to prettify Json files in a node.js script (not CLI). I found a lot of npm beautifier packages, but none that can simply beautify directly a file. There is esbeautifier that do ...
jck's user avatar
  • 529
-1 votes
1 answer
3k views

How to print out the first and last 1000 lines using beautiful soup

I am trying to print out the first and last 1000 lines using "prettify' from BeautifulSoup. I have downloaded Kafka's The Metamorphosis to my hard drive and I've successfully created a BeautifulSoup ...
James's user avatar
  • 37
0 votes
1 answer
433 views

Prettify prettyPrint() function not loading inside <script> tag

I'm using Googles prettify.js and prettify.css files hosting them myself. This is a javascript and css script that highlights source code snippets inside <pre> or <code> tags. Doc can be ...
fartagaintuxedo's user avatar
2 votes
1 answer
126 views

Automatic SyntaxHighlighter with Prettify

Working on a school project where we have creating a forum based website. We are using PageDown and Prettify to handle the text. but like it's now we have to use <!--?prettify?-->on the code to ...
elektronet's user avatar
13 votes
5 answers
17k views

How to configure atom-beautify package to format with babel/jsx javascript files?

I searched for a package to auto-indent and beautify my React/babel code. I just tried atom-beautify which seems to have good feeback on Atom. But the result on an usual babel file is not good enough:...
Damien Leroux's user avatar
0 votes
1 answer
106 views

Unsuccessful attempt using "google-code-prettify" with dynamically DOM

Inside head tag I have: <link rel="stylesheet" href="google-code-prettify/prettify.css"> <script src="google-code-prettify/prettify.js"></script> Somewhere inside body tag I have: ...
galah92's user avatar
  • 3,771
0 votes
1 answer
341 views

nginx, express, angular URL redirect loop

Not sure how to describe this problem. localhost:8000/home on my app works fine. However when I deploy to my digitalocean server and go to www.domain.com/home it looks like the url flickers and ...
Garuuk's user avatar
  • 2,183
0 votes
1 answer
2k views

Python bs4 'bytes' object has no attribute 'prettify'

I've recently tried to pull data from a website but it seems that I get an error which I can't solve on my own. So I started looking around to see if any other people had my exact same error and I ...
Naomi's user avatar
  • 291
0 votes
1 answer
618 views

Avoid CSS prettify creates new line for each tag on sublime 3

I'm using HTML - CSS - JS Prettify Plugin and sometimes when I write CSS styles I like to put them next to the other, like this h1, h2, h3, h4, h5, h6, .uk-h1, .uk-h3, .uk-h4, .uk-h5, .uk-h6 but ...
miguelopezv's user avatar
2 votes
1 answer
2k views

Python - write Xml (formatted)

I wrote this python script in order to create Xml content and i would like to write this "prettified" xml to a file (50% done): My script so far: data = ET.Element("data") project = ET....
Creative crypter's user avatar
2 votes
1 answer
352 views

Insert comments with CSScomb (using Sublime Text)

I client of mine asked to have a lot of comments in the code - including css files. So I thought about using CSScomb to reorganize the css code and add comments automatically. It doesn't make sense ...
YannickHelmut's user avatar
0 votes
0 answers
82 views

Calling google-prettify in Angularjs

I am trying to apply Google Prettify to my AngularJS code but it is working after the ng-route. I also have added a directive for prettify but still facing the problem: app.directive('prettyprint', ...
Ramana Uday's user avatar
0 votes
1 answer
307 views

How to select commands based on file syntax in Sublime Text

I spent way too much time working out exactly how to override a particular code formatting tool in favor of another one when editing JavaScript, but leaving the other one in place for formatting HTML ...
shanemgrey's user avatar
  • 2,328
1 vote
1 answer
2k views

Sublime Text HTML-CSS-JS Prettify Removing Code

HTML-CSS-JS Prettify is by far the best formatting plugin I have found for Sublime Text, but I work on HTML Emails being sent with ExactTarget. ExactTarget's Amp script for variable emails uses the ...
JSturgessMeyers's user avatar
1 vote
1 answer
63 views

Code highlighting problems with prettify in VoltRb

I've been having some problems getting the JavaScript prettify library to work on a project in VoltRb. The problem is that the code highlighting seems to work only when an error occurs and the page is ...
GDP2's user avatar
  • 1,998
0 votes
2 answers
724 views

does prettify not work with html?

I am trying to use prettify like this: <code class="prettyprint lang-html"> <link rel="stylesheet" href="themes/myPlug/styles.css?v=1.0"> <script src="js/myPlug.js"></...
Matt Welander's user avatar
0 votes
1 answer
199 views

AppleScript prettify for Sublime Text

I am looking for a way to prettify my AppleScripts when working in Sublime Text. When working in the Script Editor, compiling the script (Cmd + K) also takes care of setting the correct indentation ...
smizzlov's user avatar
  • 568
2 votes
1 answer
136 views

Can Prettify.js be used to highlight code on Wikipedia?

I want to add highlighted Mathematica source code to Wikipedia pages, samples of brief apps like those in WR's Tweet-a-Program. Currently, there's good support for Mathematica syntax highlight in ...
andandandand's user avatar
  • 22.2k