annotate docs/theme/nature/static/pygments.css @ 8769:d35d14b05b82

diff: handle some escaped characters in Git diffs There are some odd characters (like \r and \n) that the Kallithea UI doesn't allow in filenames in repos. Kallithea (through the routes module) will fail to generate URLs when browsing Files. That is a known limitation with minimal real-world impact, non-trivial to work around or fix. There are very few relevant use cases for tracking files with odd filenames. \t is valid but is hard to render in a meaningful way in the UI. And ASCII characters like \ and " are not usable on Windows and should just be avoided. Kallithea would parse Git diffs with odd characers incorrectly or fail, even before hitting the known limitation. With this change, Kallithea will parse diffs with odd filenames correctly (and then hit the limitation). Git will quote odd filenames and escape the odd characters when emitting diffs. (Mercurial does by design not allow \r and \n , and Mercurial will thus never have to quote file names in diffs.) Quotes are already handled (and ignored). With this change, Kallithea will handle \ unescaping of \\ and \", the usual letters like \r and \n and \t, and octal numbers like \033 (for ESC) . Filenames with \ and " will work perfectly (when not on Windows). Filenames with \t and ESC will work fine, but without helpful display in the UI. Filenames with \r and \n will still make the UI fail when trying to generate URLs. Thanks to stypr of Flatt Security for raising this.
author Mads Kiilerich <mads@kiilerich.com>
date Sat, 14 Nov 2020 15:41:39 +0100
parents f0384b9ed5b9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
568
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
1 .c { color: #999988; font-style: italic } /* Comment */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
2 .k { font-weight: bold } /* Keyword */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
3 .o { font-weight: bold } /* Operator */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
4 .cm { color: #999988; font-style: italic } /* Comment.Multiline */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
5 .cp { color: #999999; font-weight: bold } /* Comment.preproc */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
6 .c1 { color: #999988; font-style: italic } /* Comment.Single */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7 .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
8 .ge { font-style: italic } /* Generic.Emph */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
9 .gr { color: #aa0000 } /* Generic.Error */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
10 .gh { color: #999999 } /* Generic.Heading */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
11 .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
12 .go { color: #111 } /* Generic.Output */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
13 .gp { color: #555555 } /* Generic.Prompt */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
14 .gs { font-weight: bold } /* Generic.Strong */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
15 .gu { color: #aaaaaa } /* Generic.Subheading */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
16 .gt { color: #aa0000 } /* Generic.Traceback */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
17 .kc { font-weight: bold } /* Keyword.Constant */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
18 .kd { font-weight: bold } /* Keyword.Declaration */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
19 .kp { font-weight: bold } /* Keyword.Pseudo */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
20 .kr { font-weight: bold } /* Keyword.Reserved */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
21 .kt { color: #445588; font-weight: bold } /* Keyword.Type */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
22 .m { color: #009999 } /* Literal.Number */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
23 .s { color: #bb8844 } /* Literal.String */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
24 .na { color: #008080 } /* Name.Attribute */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
25 .nb { color: #999999 } /* Name.Builtin */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
26 .nc { color: #445588; font-weight: bold } /* Name.Class */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
27 .no { color: #ff99ff } /* Name.Constant */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
28 .ni { color: #800080 } /* Name.Entity */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
29 .ne { color: #990000; font-weight: bold } /* Name.Exception */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
30 .nf { color: #990000; font-weight: bold } /* Name.Function */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
31 .nn { color: #555555 } /* Name.Namespace */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
32 .nt { color: #000080 } /* Name.Tag */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
33 .nv { color: purple } /* Name.Variable */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
34 .ow { font-weight: bold } /* Operator.Word */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
35 .mf { color: #009999 } /* Literal.Number.Float */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
36 .mh { color: #009999 } /* Literal.Number.Hex */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
37 .mi { color: #009999 } /* Literal.Number.Integer */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
38 .mo { color: #009999 } /* Literal.Number.Oct */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
39 .sb { color: #bb8844 } /* Literal.String.Backtick */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
40 .sc { color: #bb8844 } /* Literal.String.Char */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
41 .sd { color: #bb8844 } /* Literal.String.Doc */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
42 .s2 { color: #bb8844 } /* Literal.String.Double */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
43 .se { color: #bb8844 } /* Literal.String.Escape */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
44 .sh { color: #bb8844 } /* Literal.String.Heredoc */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
45 .si { color: #bb8844 } /* Literal.String.Interpol */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
46 .sx { color: #bb8844 } /* Literal.String.Other */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
47 .sr { color: #808000 } /* Literal.String.Regex */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
48 .s1 { color: #bb8844 } /* Literal.String.Single */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
49 .ss { color: #bb8844 } /* Literal.String.Symbol */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
50 .bp { color: #999999 } /* Name.Builtin.Pseudo */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
51 .vc { color: #ff99ff } /* Name.Variable.Class */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
52 .vg { color: #ff99ff } /* Name.Variable.Global */
5f481e4e888b updated docs, added sphinx build
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
53 .vi { color: #ff99ff } /* Name.Variable.Instance */
3551
f0384b9ed5b9 codecleaner
Marcin Kuzminski <marcin@python-works.com>
parents: 3500
diff changeset
54 .il { color: #009999 } /* Literal.Number.Integer.Long */