Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: googlearchive/code-prettify
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2013-03-04
Choose a base ref
...
head repository: googlearchive/code-prettify
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 10,931 additions and 6,785 deletions.
  1. +18 −0 .gitignore
  2. +0 −172 CHANGES.html
  3. +137 −0 CHANGES.md
  4. +263 −0 Gruntfile.js
  5. +0 −111 Makefile
  6. +0 −143 README-zh-Hans.html
  7. +0 −233 README.html
  8. +248 −0 README.md
  9. +40 −0 bower.json
  10. BIN distrib/prettify-small.zip
  11. +138 −0 docs/getting_started.md
  12. +25 −15 examples/quine.html
  13. +55 −0 js-modules/defs.js
  14. +28 −0 js-modules/externs.js
  15. +3 −3 js-modules/extractSourceSpans.js
  16. +0 −129 js-modules/extractSourceSpans_test.html
  17. +0 −76 js-modules/js_include.pl
  18. +16 −0 js-modules/node_prettify.js
  19. +10 −6 js-modules/numberLines.js
  20. +0 −119 js-modules/numberLines_test.html
  21. +129 −87 js-modules/prettify.js
  22. +5 −12 js-modules/recombineTagsAndDecorations.js
  23. +0 −98 js-modules/recombineTagsAndDecorations_test.html
  24. +30 −0 js-modules/regexpPrecederPatterns.js
  25. +11 −11 js-modules/regexpPrecederPatterns.pl
  26. +73 −62 js-modules/run_prettify.js
  27. +18 −0 loader/lang-Splus.js
  28. +18 −0 loader/lang-aea.js
  29. +18 −0 loader/lang-agc.js
  30. +18 −0 loader/lang-apollo.js
  31. +18 −0 loader/lang-basic.js
  32. +18 −0 loader/lang-cbm.js
  33. +18 −0 loader/lang-cl.js
  34. +17 −0 loader/lang-clj.js
  35. +18 −0 loader/lang-css.js
  36. +19 −0 loader/lang-dart.js
  37. +18 −0 loader/lang-el.js
  38. +18 −0 loader/lang-erl.js
  39. +18 −0 loader/lang-erlang.js
  40. +19 −0 loader/lang-ex.js
  41. +19 −0 loader/lang-exs.js
  42. +18 −0 loader/lang-fs.js
  43. +17 −0 loader/lang-go.js
  44. +18 −0 loader/lang-hs.js
  45. +18 −0 loader/lang-kotlin.js
  46. +20 −0 loader/lang-lasso.js
  47. +20 −0 loader/lang-lassoscript.js
  48. +17 −0 loader/lang-latex.js
  49. +18 −0 loader/lang-lgt.js
  50. +18 −0 loader/lang-lisp.js
  51. +17 −0 loader/lang-ll.js
  52. +17 −0 loader/lang-llvm.js
  53. +18 −0 loader/lang-logtalk.js
  54. +20 −0 loader/lang-ls.js
  55. +18 −0 loader/lang-lsp.js
  56. +18 −0 loader/lang-lua.js
  57. +29 −0 loader/lang-matlab.js
  58. +18 −0 loader/lang-ml.js
  59. +18 −0 loader/lang-mumps.js
  60. +19 −0 loader/lang-n.js
  61. +19 −0 loader/lang-nemerle.js
  62. +18 −0 loader/lang-pascal.js
  63. +17 −0 loader/lang-proto.js
  64. +18 −0 loader/lang-r.js
  65. +17 −0 loader/lang-rd.js
  66. +18 −0 loader/lang-rkt.js
  67. +20 −0 loader/lang-rust.js
  68. +18 −0 loader/lang-s.js
  69. +18 −0 loader/lang-scala.js
  70. +18 −0 loader/lang-scm.js
  71. +18 −0 loader/lang-sql.js
  72. +18 −0 loader/lang-ss.js
  73. +18 −0 loader/lang-swift.js
  74. +18 −0 loader/lang-tcl.js
  75. +17 −0 loader/lang-tex.js
  76. +19 −0 loader/lang-vb.js
  77. +19 −0 loader/lang-vbs.js
  78. +19 −0 loader/lang-vhd.js
  79. +19 −0 loader/lang-vhdl.js
  80. +18 −0 loader/lang-wiki.js
  81. +19 −0 loader/lang-xq.js
  82. +19 −0 loader/lang-xquery.js
  83. +18 −0 loader/lang-yaml.js
  84. +18 −0 loader/lang-yml.js
  85. +1 −0 loader/prettify.css
  86. +46 −0 loader/prettify.js
  87. +64 −0 loader/run_prettify.js
  88. +1 −0 loader/skins/desert.css
  89. +1 −0 loader/skins/doxy.css
  90. +1 −0 loader/skins/sons-of-obsidian.css
  91. +1 −0 loader/skins/sunburst.css
  92. +59 −0 package.json
  93. +16 −14 src/lang-apollo.js
  94. +17 −0 src/lang-basic.js
  95. +16 −15 src/lang-css.js
  96. +21 −17 src/lang-dart.js
  97. +16 −14 src/lang-erlang.js
  98. +82 −0 src/lang-ex.js
  99. +16 −15 src/lang-go.js
  100. +16 −15 src/lang-hs.js
  101. +58 −0 src/lang-kotlin.js
  102. +67 −0 src/lang-lasso.js
  103. +16 −15 src/lang-lisp.js
  104. +16 −14 src/lang-llvm.js
  105. +50 −0 src/lang-logtalk.js
  106. +16 −15 src/lang-lua.js
  107. +22 −19 src/lang-matlab.js
  108. +16 −15 src/lang-ml.js
  109. +16 −15 src/lang-mumps.js
  110. +16 −14 src/lang-n.js
  111. +17 −0 src/lang-pascal.js
  112. +16 −14 src/lang-proto.js
  113. +16 −14 src/lang-r.js
  114. +16 −13 src/lang-rd.js
  115. +81 −0 src/lang-rust.js
  116. +16 −14 src/lang-scala.js
  117. +16 −15 src/lang-sql.js
  118. +60 −0 src/lang-swift.js
  119. +16 −15 src/lang-tcl.js
  120. +16 −13 src/lang-tex.js
  121. +16 −15 src/lang-vb.js
  122. +17 −0 src/lang-vhdl.js
  123. +16 −14 src/lang-wiki.js
  124. +18 −14 src/lang-xq.js
  125. +19 −1 src/lang-yaml.js
  126. +1,715 −0 src/node_prettify.js
  127. +18 −0 src/prettify.css
  128. +250 −155 src/prettify.js
  129. +382 −279 src/run_prettify.js
  130. +77 −27 styles/demo.html
  131. +1 −1 styles/doxy.css
  132. +75 −61 styles/index.html
  133. +0 −5 styles/sunburst.css
  134. +72 −0 tasks/aliases.js
  135. +49 −0 tasks/gcc.js
  136. +92 −0 tasks/lib/lang-aliases.js
  137. +70 −47 tests/debug-ie-compat-matrix.html
  138. +146 −0 tests/extractSourceSpans_test.html
  139. +104 −98 tests/ie-newline-copy-paste.html
  140. +163 −82 tests/large_input_test.html
  141. +135 −0 tests/numberLines_test.html
  142. +276 −1,892 tests/prettify_test.html
  143. +1,782 −0 tests/prettify_test.js
  144. +259 −1,052 tests/prettify_test_2.html
  145. +1,072 −0 tests/prettify_test_2.js
  146. +119 −0 tests/recombineTagsAndDecorations_test.html
  147. +70 −49 tests/run_prettify_test.html
  148. +105 −0 tests/shims.js
  149. +341 −180 tests/test_base.js
  150. +89 −0 tests/test_in_node
  151. +90 −0 tests/test_modules.css
  152. +61 −5 tests/test_styles.css
  153. +0 −202 tools/closure-compiler/COPYING
  154. +0 −278 tools/closure-compiler/README
  155. BIN tools/closure-compiler/compiler.jar
  156. +0 −234 tools/cut-release.sh
  157. +0 −256 tools/googlecode_upload.py
  158. +0 −67 tools/lang-handler-aliases.sh
  159. +0 −54 tools/yui-compressor/LICENSE.TXT
  160. +0 −145 tools/yui-compressor/README
  161. BIN tools/yui-compressor/yuicompressor-2.4.4.jar
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# temporary files
*~
*.swp
.DS_Store

# package managers
/node_modules/
/bower_components/
npm-debug.log
.bower.json

# generated files
#/src/prettify.js
#/src/run_prettify.js
#/loader/*.js
#/loader/*.css
#/loader/skins/*.css
#/distrib/*.zip
172 changes: 0 additions & 172 deletions CHANGES.html

This file was deleted.

137 changes: 137 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# Known Issues

* Perl formatting is really crappy. Partly because the author is lazy and partly
because Perl is [hard](http://www.perlmonks.org/?node_id=663393) to parse.
* On some browsers, `<code>` elements with newlines in the text which use CSS
to specify `white-space:pre` will have the newlines improperly stripped if
the element is not attached to the document at the time the stripping is done.
Also, on IE6, all newlines will be stripped from `<code>` elements because
of the way IE6 produces `innerHTML`. Workaround: use `<pre>` for code with
newlines.

# Change Log

## 29 March 2007

* Added [tests](https://raw.githack.com/google/code-prettify/master/tests/prettify_test.html#php)
for PHP support to address issue [#3](https://github.com/google/code-prettify/issues/3).
* Fixed bug [#6](https://github.com/google/code-prettify/issues/6): `prettyPrintOne`
was not halting. This was not reachable through the normal entry point.
* Fixed bug [#4](https://github.com/google/code-prettify/issues/4): recursing into a
script block or PHP tag that was not properly closed would not silently drop the content.
([test](https://raw.githack.com/google/code-prettify/master/tests/prettify_test.html#js_script))
* Fixed bug [#8](https://github.com/google/code-prettify/issues/8): was eating tabs
([test](https://raw.githack.com/google/code-prettify/master/tests/prettify_test.html#issue8))
* Fixed entity handling so that the caveat

> Caveats: please properly escape less-thans. `x&lt;y` instead of `x<y`,
> and use `"` instead of `&quot;` for string delimiters.
is no longer applicable.
* Added *noisefree*'s C# patch [#7](https://github.com/google/code-prettify/issues/7)
* Added a [distribution](http://google-code-prettify.googlecode.com/files/prettify-small.zip)
that has comments and whitespace removed to reduce download size from 45.5kB
to 12.8kB.

## 4 Jul 2008

* Added [#17](https://github.com/google/code-prettify/issues/17) language specific
formatters that are triggered by the presence of a `lang-<language-file-extension>`
* Fixed bug [#29](https://github.com/google/code-prettify/issues/29): python
handling of `'''string'''`
* Fixed bug: `/` in regex `[charsets] should not end regex`

## 5 Jul 2008

* Defined language extensions for Lisp and Lua

## 14 Jul 2008

* Language handlers for F#, OCAML, SQL
* Support for `nocode` spans to allow embedding of line numbers and code
annotations which should not be styled or otherwise affect the tokenization
of prettified code. See the issue [#22](https://github.com/google/code-prettify/issues/22)
[testcase](https://raw.githack.com/google/code-prettify/master/tests/prettify_test.html#issue22).

## 6 Jan 2009

* Language handlers for Visual Basic, Haskell, CSS, and WikiText
* Added `.mxml` extension to the markup style handler for
Flex [MXML files](http://en.wikipedia.org/wiki/MXML).
See issue [#37](https://github.com/google/code-prettify/issues/37).
* Added `.m` extension to the C style handler so that Objective C source files
properly highlight. See issue [#58](https://github.com/google/code-prettify/issues/58).
* Changed HTML lexer to use the same embedded source mechanism as the wiki
language handler, and changed to use the registered CSS handler for STYLE
element content.

## 21 May 2009

* Rewrote to improve performance on large files.
See [benchmarks](http://mikesamuel.blogspot.com/2009/05/efficient-parsing-in-javascript.html).
* Fixed bugs with highlighting of Haskell line comments, Lisp number literals,
Lua strings, C preprocessor directives, newlines in Wiki code on Windows, and
newlines in IE6.

## 14 August 2009

* Fixed prettifying of `<code>` blocks with embedded newlines.

## 3 October 2009

* Fixed prettifying of XML/HTML tags that contain uppercase letters.

## 19 July 2010

* Added support for line numbers. Bug [#22](https://github.com/google/code-prettify/issues/22)
* Added YAML support. Bug [#123](https://github.com/google/code-prettify/issues/123)
* Added VHDL support courtesy *Le Poussin*.
* IE performance improvements. Bug [#102](https://github.com/google/code-prettify/issues/102)
courtesy *jacobly*.
* A variety of markup formatting fixes courtesy *smain* and *thezbyg*.
* Fixed copy and paste in IE 6, 7, 8.
* Changed output to use `&#160;` instead of `&nbsp;` so that the output works
when embedded in XML. Bug [#108](https://github.com/google/code-prettify/issues/108).

## 7 September 2010

* Added support for coffeescript courtesy *Cezary Bartoszuk*.

## 4 March 2011

* Added a [themes gallery](https://raw.githack.com/google/code-prettify/master/styles/index.html)
to showcase contributed styles.
* Added support for XQuery courtesy *Patrick Wied*, Nemerle courtesy *Zimin A.V.*,
and Latex support courtesy *Martin S*.

## 29 March 2011

* Fixed IE newline issues, and copying/pasting of prettified source code from IE.
This required significant internal changes but involves no API changes.
**Caveat**: `prettyPrintOne` injects the HTML passed to it into a `<pre>` element.
If the HTML comes from a trusted source, this may allow XSS. Do not do this.
This should not be a problem for existing apps since the standard usage is to
rewrite the HTML and then inject it, so anyone doing that with untrusted HTML
already has an XSS vulnerability. If you sanitize and prettify HTML from an
untrusted source, sanitize first.

## 4 February 2013

* Language handlers for Dart, Erlang, Mumps, TCL, R, S., and others
* Bug fix: VB REM style comments.
* Bug fix: CSS color literals / ID selector confusion.
* Bug fix: IE8 line breaks.

## 24 February 2013

* Added a one script autoload&run mechanism and a way to embed hints in
processing instructions/comments. See
[example](https://raw.githack.com/google/code-prettify/master/examples/quine.html).

## 4 March 2013

* Matlab language handler courtesy *Amro³*

## 28 Apr 2015

* Migrated to Github
Loading