Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: tools/json_schema_compiler/highlighters/none_highlighter.py

Issue 10833024: Fix syntax highlighting in JSON Schema Compiler's preview server: don't crash (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: . Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/json_schema_compiler/highlighters/pygments_highlighter.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import cgi
6
5 class NoneHighlighter(object): 7 class NoneHighlighter(object):
6 """Highlighter that just wraps code in a <pre>. 8 """Highlighter that just wraps code in a <pre>.
7 """ 9 """
8 def GetCSS(self, style): 10 def GetCSS(self, style):
9 return '' 11 return ''
10 12
11 def GetCodeElement(self, code, style): 13 def GetCodeElement(self, code, style):
12 return '<pre>' + code + '</pre>' 14 return '<pre>' + cgi.escape(code) + '</pre>'
13 15
14 def DisplayName(self): 16 def DisplayName(self):
15 return 'none' 17 return 'none'
16 18
17 def GetStyles(self): 19 def GetStyles(self):
18 return [] 20 return []
OLDNEW
« no previous file with comments | « no previous file | tools/json_schema_compiler/highlighters/pygments_highlighter.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698