Skip to content

Commit 06c488d

Browse files
committed
Merge pull request github#350 from github/tidy-up-the-readme
Tidy up the readme
2 parents 90a4042 + 65ef71b commit 06c488d

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

README.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,36 @@ Or, more realistically:
3737
require 'github/markup'
3838
GitHub::Markup.render(file, File.read(file))
3939

40+
Contributing
41+
------------
42+
43+
See [Contributing](CONTRIBUTING.md)
44+
4045
HTML sanitization
4146
-----------------
4247

4348
HTML rendered by the various markup language processors gets passed through an [HTML sanitization filter](https://github.com/jch/html-pipeline/blob/master/lib/html/pipeline/sanitization_filter.rb) for security reasons. HTML elements not in the whitelist are removed. HTML attributes not in the whitelist are removed from the preserved elements.
4449

4550
The following HTML elements, organized by category, are whitelisted:
4651

47-
* Headings: h1, h2, h3, h4, h5, h6, h7, h8
48-
* Prose: p, div, blockquote
49-
* Preformatted: pre
50-
* Inline: b, i, strong, em, tt, code, ins, del, sup, sub, kbd, samp, q, var
51-
* Lists: ol, ul, li, dl, dt, dd
52-
* Tables: table, thead, tbody, tfoot, tr, td, th
53-
* Breaks: br, hr
54-
* Ruby (East Asian): ruby, rt, rp
52+
|Type | Elements
53+
|------|----------
54+
|Headings | `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `h7`, `h8`
55+
|Prose | `p`, `div`, `blockquote`
56+
|Formatted | `pre`
57+
| Inline | `b`, `i`, `strong`, `em`, `tt`, `code`, `ins`, `del`, `sup`, `sub`, `kbd`, `samp`, `q`, `var`
58+
| Lists | `ol`, `ul`, `li`, `dl`, `dt`, `dd`
59+
| Tables | `table`, `thead`, `tbody`, `tfoot`, `tr`, `td`, `th`
60+
| Breaks | `br`, `hr
61+
| Ruby (East Asian) | `ruby`, `rt`, `rp`
5562

5663
The following attributes, organized by element, are whitelisted:
5764

58-
* a: href (http://, https://, mailto://, github-windows:// and github-mac:// URI schemes and relative paths only)
59-
* img: src (http:// and https:// URI schemes and relative paths only)
60-
* div: itemscope, itemtype
61-
* all: abbr, accept, accept-charset, accesskey, action, align, alt, axis, border, cellpadding, cellspacing, char, charoff, charset, checked, cite, clear, cols, colspan, color, compact, coords, datetime, dir, disabled, enctype, for, frame, headers, height, hreflang, hspace, ismap, label, lang, longdesc, maxlength, media, method, multiple, name, nohref, noshade, nowrap, prompt, readonly, rel, rev, rows, rowspan, rules, scope, selected, shape, size, span, start, summary, tabindex, target, title, type, usemap, valign, value, vspace, width, itemprop
65+
|Element | Attributes
66+
|------|----------
67+
| `a` | `href` (`http://`, `https://`, `mailto://`, `github-windows://`, and `github-mac://` URI schemes and relative paths only)
68+
| `img` | `src` (`http://` and `https://` URI schemes and relative paths only)
69+
| `div` | `itemscope`, `itemtype`
70+
| All | `abbr`, `accept`, `accept-charset`, `accesskey`, `action`, `align`, `alt`, `axis`, `border`, `cellpadding`, `cellspacing`, `char`, `charoff`, `charset`, `checked`, `cite`, `clear`, `cols`, `colspan`, `color`, `compact`, `coords`, `datetime`, `dir`, `disabled`, `enctype`, `for`, `frame`, `headers`, `height`, `hreflang`, `hspace`, `ismap`, `label`, `lang`, `longdesc`, `maxlength`, `media`, `method`, `multiple`, `name`, `nohref`, `noshade`, `nowrap`, `prompt`, `readonly`, `rel`, `rev`, `rows`, `rowspan`, `rules`, `scope`, `selected`, `shape`, `size`, `span`, `start`, `summary`, `tabindex`, `target`, `title`, `type`, `usemap`, `valign`, `value`, `vspace`, `width`, `itemprop`
6271

63-
Note that the id attribute is *not* whitelisted.
64-
65-
Contributing
66-
------------
67-
68-
See [Contributing](CONTRIBUTING.md)
72+
Note that the `id` attribute is *not* whitelisted.

0 commit comments

Comments
 (0)