shinmun 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/LICENSE +18 -0
- data/README.md +249 -0
- data/Rakefile +60 -0
- data/bin/shinmun +12 -0
- data/example/posts/2008/9/example.md +19 -0
- data/example/posts/blog.yml +10 -0
- data/example/posts/uuid.state +3 -0
- data/example/public/controllers/comments.php +56 -0
- data/example/public/images/loading.gif +0 -0
- data/example/public/javascripts/comments.js +60 -0
- data/example/public/javascripts/highlight.js +505 -0
- data/example/public/javascripts/images/bg-fill.png +0 -0
- data/example/public/javascripts/images/bg.png +0 -0
- data/example/public/javascripts/images/blockquote.png +0 -0
- data/example/public/javascripts/images/bold.png +0 -0
- data/example/public/javascripts/images/code.png +0 -0
- data/example/public/javascripts/images/h1.png +0 -0
- data/example/public/javascripts/images/hr.png +0 -0
- data/example/public/javascripts/images/img.png +0 -0
- data/example/public/javascripts/images/italic.png +0 -0
- data/example/public/javascripts/images/link.png +0 -0
- data/example/public/javascripts/images/ol.png +0 -0
- data/example/public/javascripts/images/redo.png +0 -0
- data/example/public/javascripts/images/separator.png +0 -0
- data/example/public/javascripts/images/ul.png +0 -0
- data/example/public/javascripts/images/undo.png +0 -0
- data/example/public/javascripts/images/wmd-on.png +0 -0
- data/example/public/javascripts/images/wmd.png +0 -0
- data/example/public/javascripts/jquery-form.js +869 -0
- data/example/public/javascripts/jquery.js +3383 -0
- data/example/public/javascripts/languages/1c.js +82 -0
- data/example/public/javascripts/languages/axapta.js +52 -0
- data/example/public/javascripts/languages/bash.js +80 -0
- data/example/public/javascripts/languages/diff.js +64 -0
- data/example/public/javascripts/languages/dos.js +33 -0
- data/example/public/javascripts/languages/dynamic.js +460 -0
- data/example/public/javascripts/languages/ini.js +36 -0
- data/example/public/javascripts/languages/javascript.js +38 -0
- data/example/public/javascripts/languages/lisp.js +86 -0
- data/example/public/javascripts/languages/mel.js +50 -0
- data/example/public/javascripts/languages/profile.js +50 -0
- data/example/public/javascripts/languages/renderman.js +71 -0
- data/example/public/javascripts/languages/smalltalk.js +53 -0
- data/example/public/javascripts/languages/sql.js +50 -0
- data/example/public/javascripts/languages/static.js +175 -0
- data/example/public/javascripts/languages/vbscript.js +25 -0
- data/example/public/javascripts/languages/www.js +245 -0
- data/example/public/javascripts/prettyDate.js +36 -0
- data/example/public/javascripts/showdown.js +421 -0
- data/example/public/javascripts/template.js +165 -0
- data/example/public/javascripts/wmd-base.js +1799 -0
- data/example/public/javascripts/wmd-plus.js +311 -0
- data/example/public/javascripts/wmd.js +73 -0
- data/example/public/stylesheets/grid.css +243 -0
- data/example/public/stylesheets/grid.png +0 -0
- data/example/public/stylesheets/highlight/ascetic.css +38 -0
- data/example/public/stylesheets/highlight/dark.css +96 -0
- data/example/public/stylesheets/highlight/default.css +91 -0
- data/example/public/stylesheets/highlight/far.css +95 -0
- data/example/public/stylesheets/highlight/idea.css +75 -0
- data/example/public/stylesheets/highlight/sunburst.css +112 -0
- data/example/public/stylesheets/highlight/zenburn.css +108 -0
- data/example/public/stylesheets/print.css +76 -0
- data/example/public/stylesheets/reset.css +45 -0
- data/example/public/stylesheets/style.css +141 -0
- data/example/public/stylesheets/typography.css +59 -0
- data/example/templates/feed.rxml +21 -0
- data/example/templates/layout.rhtml +54 -0
- data/example/templates/page.rhtml +4 -0
- data/example/templates/post.rhtml +57 -0
- data/example/templates/posts.rhtml +10 -0
- data/lib/shinmun.rb +420 -0
- metadata +151 -0
@@ -0,0 +1,245 @@
|
|
1
|
+
hljs.XML_COMMENT = {
|
2
|
+
className: 'comment',
|
3
|
+
begin: '<!--', end: '-->'
|
4
|
+
};
|
5
|
+
hljs.XML_ATTR = {
|
6
|
+
className: 'attribute',
|
7
|
+
begin: ' [a-zA-Z\\:-]+=', end: '^',
|
8
|
+
contains: ['value']
|
9
|
+
};
|
10
|
+
hljs.XML_VALUE = {
|
11
|
+
className: 'value',
|
12
|
+
begin: '"', end: '"'
|
13
|
+
};
|
14
|
+
|
15
|
+
hljs.LANGUAGES.xml = {
|
16
|
+
defaultMode: {
|
17
|
+
contains: ['pi', 'comment', 'cdata', 'tag']
|
18
|
+
},
|
19
|
+
case_insensitive: true,
|
20
|
+
modes: [
|
21
|
+
{
|
22
|
+
className: 'pi',
|
23
|
+
begin: '<\\?', end: '\\?>',
|
24
|
+
relevance: 10
|
25
|
+
},
|
26
|
+
hljs.XML_COMMENT,
|
27
|
+
{
|
28
|
+
className: 'cdata',
|
29
|
+
begin: '<\\!\\[CDATA\\[', end: '\\]\\]>'
|
30
|
+
},
|
31
|
+
{
|
32
|
+
className: 'tag',
|
33
|
+
begin: '</?', end: '>',
|
34
|
+
contains: ['title', 'tag_internal'],
|
35
|
+
relevance: 1.5
|
36
|
+
},
|
37
|
+
{
|
38
|
+
className: 'title',
|
39
|
+
begin: '[A-Za-z:_][A-Za-z0-9\\._:-]+', end: '^',
|
40
|
+
relevance: 0
|
41
|
+
},
|
42
|
+
{
|
43
|
+
className: 'tag_internal',
|
44
|
+
begin: '^', endsWithParent: true,
|
45
|
+
contains: ['attribute'],
|
46
|
+
relevance: 0,
|
47
|
+
illegal: '[\\+\\.]'
|
48
|
+
},
|
49
|
+
hljs.XML_ATTR,
|
50
|
+
hljs.XML_VALUE
|
51
|
+
]
|
52
|
+
};
|
53
|
+
|
54
|
+
hljs.HTML_TAGS = {'code': 1, 'kbd': 1, 'font': 1, 'noscript': 1, 'style': 1, 'img': 1, 'title': 1, 'menu': 1, 'tt': 1, 'tr': 1, 'param': 1, 'li': 1, 'tfoot': 1, 'th': 1, 'input': 1, 'td': 1, 'dl': 1, 'blockquote': 1, 'fieldset': 1, 'big': 1, 'dd': 1, 'abbr': 1, 'optgroup': 1, 'dt': 1, 'button': 1, 'isindex': 1, 'p': 1, 'small': 1, 'div': 1, 'dir': 1, 'em': 1, 'frame': 1, 'meta': 1, 'sub': 1, 'bdo': 1, 'label': 1, 'acronym': 1, 'sup': 1, 'body': 1, 'xml': 1, 'basefont': 1, 'base': 1, 'br': 1, 'address': 1, 'strong': 1, 'legend': 1, 'ol': 1, 'script': 1, 'caption': 1, 's': 1, 'col': 1, 'h2': 1, 'h3': 1, 'h1': 1, 'h6': 1, 'h4': 1, 'h5': 1, 'table': 1, 'select': 1, 'noframes': 1, 'span': 1, 'area': 1, 'dfn': 1, 'strike': 1, 'cite': 1, 'thead': 1, 'head': 1, 'option': 1, 'form': 1, 'hr': 1, 'var': 1, 'link': 1, 'b': 1, 'colgroup': 1, 'ul': 1, 'applet': 1, 'del': 1, 'iframe': 1, 'pre': 1, 'frameset': 1, 'ins': 1, 'tbody': 1, 'html': 1, 'samp': 1, 'map': 1, 'object': 1, 'a': 1, 'xmlns': 1, 'center': 1, 'textarea': 1, 'i': 1, 'q': 1, 'u': 1};
|
55
|
+
hljs.HTML_DOCTYPE = {
|
56
|
+
className: 'doctype',
|
57
|
+
begin: '<!DOCTYPE', end: '>',
|
58
|
+
relevance: 10
|
59
|
+
};
|
60
|
+
hljs.HTML_ATTR = {
|
61
|
+
className: 'attribute',
|
62
|
+
begin: ' [a-zA-Z]+', end: '^'
|
63
|
+
};
|
64
|
+
hljs.HTML_VALUE = {
|
65
|
+
className: 'value',
|
66
|
+
begin: '[a-zA-Z0-9]+', end: '^'
|
67
|
+
};
|
68
|
+
|
69
|
+
hljs.LANGUAGES.html = {
|
70
|
+
defaultMode: {
|
71
|
+
contains: ['tag', 'comment', 'doctype', 'vbscript']
|
72
|
+
},
|
73
|
+
case_insensitive: true,
|
74
|
+
modes: [
|
75
|
+
hljs.XML_COMMENT,
|
76
|
+
hljs.HTML_DOCTYPE,
|
77
|
+
{
|
78
|
+
className: 'tag',
|
79
|
+
lexems: [hljs.IDENT_RE],
|
80
|
+
keywords: hljs.HTML_TAGS,
|
81
|
+
begin: '<style', end: '>',
|
82
|
+
contains: ['attribute'],
|
83
|
+
illegal: '[\\+\\.]',
|
84
|
+
starts: 'css'
|
85
|
+
},
|
86
|
+
{
|
87
|
+
className: 'tag',
|
88
|
+
lexems: [hljs.IDENT_RE],
|
89
|
+
keywords: hljs.HTML_TAGS,
|
90
|
+
begin: '<script', end: '>',
|
91
|
+
contains: ['attribute'],
|
92
|
+
illegal: '[\\+\\.]',
|
93
|
+
starts: 'javascript'
|
94
|
+
},
|
95
|
+
{
|
96
|
+
className: 'tag',
|
97
|
+
lexems: [hljs.IDENT_RE],
|
98
|
+
keywords: hljs.HTML_TAGS,
|
99
|
+
begin: '<[A-Za-z/]', end: '>',
|
100
|
+
contains: ['attribute'],
|
101
|
+
illegal: '[\\+\\.]'
|
102
|
+
},
|
103
|
+
{
|
104
|
+
className: 'css',
|
105
|
+
end: '</style>', returnEnd: true,
|
106
|
+
subLanguage: 'css'
|
107
|
+
},
|
108
|
+
{
|
109
|
+
className: 'javascript',
|
110
|
+
end: '</script>', returnEnd: true,
|
111
|
+
subLanguage: 'javascript'
|
112
|
+
},
|
113
|
+
hljs.XML_ATTR,
|
114
|
+
hljs.HTML_ATTR,
|
115
|
+
hljs.XML_VALUE,
|
116
|
+
hljs.HTML_VALUE,
|
117
|
+
{
|
118
|
+
className: 'vbscript',
|
119
|
+
begin: '<%', end: '%>',
|
120
|
+
subLanguage: 'vbscript'
|
121
|
+
}
|
122
|
+
]
|
123
|
+
};
|
124
|
+
|
125
|
+
hljs.LANGUAGES.css = {
|
126
|
+
defaultMode: {
|
127
|
+
contains: ['id', 'class', 'attr_selector', 'rules', 'comment'],
|
128
|
+
keywords: hljs.HTML_TAGS,
|
129
|
+
lexems: [hljs.IDENT_RE],
|
130
|
+
illegal: '='
|
131
|
+
},
|
132
|
+
case_insensitive: true,
|
133
|
+
modes: [
|
134
|
+
{
|
135
|
+
className: 'id',
|
136
|
+
begin: '\\#[A-Za-z0-9_-]+', end: '^'
|
137
|
+
},
|
138
|
+
{
|
139
|
+
className: 'class',
|
140
|
+
begin: '\\.[A-Za-z0-9_-]+', end: '^',
|
141
|
+
relevance: 0
|
142
|
+
},
|
143
|
+
{
|
144
|
+
className: 'attr_selector',
|
145
|
+
begin: '\\[', end: '\\]',
|
146
|
+
illegal: '$'
|
147
|
+
},
|
148
|
+
{
|
149
|
+
className: 'rules',
|
150
|
+
begin: '{', end: '}',
|
151
|
+
contains: ['rule', 'comment'],
|
152
|
+
illegal: '[^\\s]'
|
153
|
+
},
|
154
|
+
{
|
155
|
+
className: 'rule',
|
156
|
+
begin: '[A-Z\\_\\.\\-]+\\s*:', end: ';', endsWithParent: true,
|
157
|
+
lexems: ['[A-Za-z-]+'],
|
158
|
+
keywords: {'play-during': 1, 'counter-reset': 1, 'counter-increment': 1, 'min-height': 1, 'quotes': 1, 'border-top': 1, 'pitch': 1, 'font': 1, 'pause': 1, 'list-style-image': 1, 'border-width': 1, 'cue': 1, 'outline-width': 1, 'border-left': 1, 'elevation': 1, 'richness': 1, 'speech-rate': 1, 'border-bottom': 1, 'border-spacing': 1, 'background': 1, 'list-style-type': 1, 'text-align': 1, 'page-break-inside': 1, 'orphans': 1, 'page-break-before': 1, 'text-transform': 1, 'line-height': 1, 'padding-left': 1, 'font-size': 1, 'right': 1, 'word-spacing': 1, 'padding-top': 1, 'outline-style': 1, 'bottom': 1, 'content': 1, 'border-right-style': 1, 'padding-right': 1, 'border-left-style': 1, 'voice-family': 1, 'background-color': 1, 'border-bottom-color': 1, 'outline-color': 1, 'unicode-bidi': 1, 'max-width': 1, 'font-family': 1, 'caption-side': 1, 'border-right-width': 1, 'pause-before': 1, 'border-top-style': 1, 'color': 1, 'border-collapse': 1, 'border-bottom-width': 1, 'float': 1, 'height': 1, 'max-height': 1, 'margin-right': 1, 'border-top-width': 1, 'speak': 1, 'speak-header': 1, 'top': 1, 'cue-before': 1, 'min-width': 1, 'width': 1, 'font-variant': 1, 'border-top-color': 1, 'background-position': 1, 'empty-cells': 1, 'direction': 1, 'border-right': 1, 'visibility': 1, 'padding': 1, 'border-style': 1, 'background-attachment': 1, 'overflow': 1, 'border-bottom-style': 1, 'cursor': 1, 'margin': 1, 'display': 1, 'border-left-width': 1, 'letter-spacing': 1, 'vertical-align': 1, 'clip': 1, 'border-color': 1, 'list-style': 1, 'padding-bottom': 1, 'pause-after': 1, 'speak-numeral': 1, 'margin-left': 1, 'widows': 1, 'border': 1, 'font-style': 1, 'border-left-color': 1, 'pitch-range': 1, 'background-repeat': 1, 'table-layout': 1, 'margin-bottom': 1, 'speak-punctuation': 1, 'font-weight': 1, 'border-right-color': 1, 'page-break-after': 1, 'position': 1, 'white-space': 1, 'text-indent': 1, 'background-image': 1, 'volume': 1, 'stress': 1, 'outline': 1, 'clear': 1, 'z-index': 1, 'text-decoration': 1, 'margin-top': 1, 'azimuth': 1, 'cue-after': 1, 'left': 1, 'list-style-position': 1},
|
159
|
+
contains: ['value']
|
160
|
+
},
|
161
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
162
|
+
{
|
163
|
+
className: 'value',
|
164
|
+
begin: '^', endsWithParent: true, excludeEnd: true,
|
165
|
+
contains: ['function', 'number', 'hexcolor', 'string']
|
166
|
+
},
|
167
|
+
{
|
168
|
+
className: 'number',
|
169
|
+
begin: hljs.NUMBER_RE, end: '^'
|
170
|
+
},
|
171
|
+
{
|
172
|
+
className: 'hexcolor',
|
173
|
+
begin: '\\#[0-9A-F]+', end: '^'
|
174
|
+
},
|
175
|
+
{
|
176
|
+
className: 'function',
|
177
|
+
begin: hljs.IDENT_RE + '\\(', end: '\\)',
|
178
|
+
contains: ['params']
|
179
|
+
},
|
180
|
+
{
|
181
|
+
className: 'params',
|
182
|
+
begin: '^', endsWithParent: true, excludeEnd: true,
|
183
|
+
contains: ['number', 'string']
|
184
|
+
},
|
185
|
+
hljs.APOS_STRING_MODE,
|
186
|
+
hljs.QUOTE_STRING_MODE
|
187
|
+
]
|
188
|
+
};
|
189
|
+
|
190
|
+
hljs.LANGUAGES.django = {
|
191
|
+
defaultMode: {
|
192
|
+
contains: ['tag', 'comment', 'doctype', 'template_comment', 'template_tag', 'variable']
|
193
|
+
},
|
194
|
+
case_insensitive: true,
|
195
|
+
modes: [
|
196
|
+
hljs.XML_COMMENT,
|
197
|
+
hljs.HTML_DOCTYPE,
|
198
|
+
{
|
199
|
+
className: 'tag',
|
200
|
+
lexems: [hljs.IDENT_RE],
|
201
|
+
keywords: hljs.HTML_TAGS,
|
202
|
+
begin: '<[A-Za-z/]', end: '>',
|
203
|
+
contains: ['attribute', 'template_comment', 'template_tag', 'variable']
|
204
|
+
},
|
205
|
+
hljs.XML_ATTR,
|
206
|
+
hljs.HTML_ATTR,
|
207
|
+
{
|
208
|
+
className: 'value',
|
209
|
+
begin: '"', end: '"',
|
210
|
+
contains: ['template_comment', 'template_tag', 'variable']
|
211
|
+
},
|
212
|
+
hljs.HTML_VALUE,
|
213
|
+
{
|
214
|
+
className: 'template_comment',
|
215
|
+
begin: '\\{\\%\\s*comment\\s*\\%\\}', end: '\\{\\%\\s*endcomment\\s*\\%\\}'
|
216
|
+
},
|
217
|
+
{
|
218
|
+
className: 'template_comment',
|
219
|
+
begin: '\\{#', end: '#\\}'
|
220
|
+
},
|
221
|
+
{
|
222
|
+
className: 'template_tag',
|
223
|
+
begin: '\\{\\%', end: '\\%\\}',
|
224
|
+
lexems: [hljs.IDENT_RE],
|
225
|
+
keywords: {'comment': 1, 'endcomment': 1, 'load': 1, 'templatetag': 1, 'ifchanged': 1, 'endifchanged': 1, 'if': 1, 'endif': 1, 'firstof': 1, 'for': 1, 'endfor': 1, 'in': 1, 'ifnotequal': 1, 'endifnotequal': 1, 'widthratio': 1, 'extends': 1, 'include': 1, 'spaceless': 1, 'endspaceless': 1, 'regroup': 1, 'by': 1, 'as': 1, 'ifequal': 1, 'endifequal': 1, 'ssi': 1, 'now': 1, 'with': 1, 'cycle': 1, 'url': 1, 'filter': 1, 'endfilter': 1, 'debug': 1, 'block': 1, 'endblock': 1, 'else': 1},
|
226
|
+
contains: ['filter']
|
227
|
+
},
|
228
|
+
{
|
229
|
+
className: 'variable',
|
230
|
+
begin: '\\{\\{', end: '\\}\\}',
|
231
|
+
contains: ['filter']
|
232
|
+
},
|
233
|
+
{
|
234
|
+
className: 'filter',
|
235
|
+
begin: '\\|[A-Za-z]+\\:?', end: '^', excludeEnd: true,
|
236
|
+
lexems: [hljs.IDENT_RE],
|
237
|
+
keywords: {'truncatewords': 1, 'removetags': 1, 'linebreaksbr': 1, 'yesno': 1, 'get_digit': 1, 'timesince': 1, 'random': 1, 'striptags': 1, 'filesizeformat': 1, 'escape': 1, 'linebreaks': 1, 'length_is': 1, 'ljust': 1, 'rjust': 1, 'cut': 1, 'urlize': 1, 'fix_ampersands': 1, 'title': 1, 'floatformat': 1, 'capfirst': 1, 'pprint': 1, 'divisibleby': 1, 'add': 1, 'make_list': 1, 'unordered_list': 1, 'urlencode': 1, 'timeuntil': 1, 'urlizetrunc': 1, 'wordcount': 1, 'stringformat': 1, 'linenumbers': 1, 'slice': 1, 'date': 1, 'dictsort': 1, 'dictsortreversed': 1, 'default_if_none': 1, 'pluralize': 1, 'lower': 1, 'join': 1, 'center': 1, 'default': 1, 'truncatewords_html': 1, 'upper': 1, 'length': 1, 'phone2numeric': 1, 'wordwrap': 1, 'time': 1, 'addslashes': 1, 'slugify': 1, 'first': 1},
|
238
|
+
contains: ['argument']
|
239
|
+
},
|
240
|
+
{
|
241
|
+
className: 'argument',
|
242
|
+
begin: '"', end: '"'
|
243
|
+
}
|
244
|
+
]
|
245
|
+
};
|
@@ -0,0 +1,36 @@
|
|
1
|
+
/*
|
2
|
+
* JavaScript Pretty Date
|
3
|
+
* Copyright (c) 2008 John Resig (jquery.com)
|
4
|
+
* Licensed under the MIT license.
|
5
|
+
*/
|
6
|
+
|
7
|
+
// Takes an ISO time and returns a string representing how
|
8
|
+
// long ago the date represents.
|
9
|
+
function prettyDate(time){
|
10
|
+
var date = new Date((time || "").replace(/-/g,"/").replace(/[TZ]/g," ")),
|
11
|
+
diff = (((new Date()).getTime() - date.getTime()) / 1000),
|
12
|
+
day_diff = Math.floor(diff / 86400);
|
13
|
+
|
14
|
+
if ( isNaN(day_diff) || day_diff < 0 || day_diff >= 31 )
|
15
|
+
return false;
|
16
|
+
|
17
|
+
return day_diff == 0 && (
|
18
|
+
diff < 60 && "just now" ||
|
19
|
+
diff < 120 && "1 minute ago" ||
|
20
|
+
diff < 3600 && Math.floor( diff / 60 ) + " minutes ago" ||
|
21
|
+
diff < 7200 && "1 hour ago" ||
|
22
|
+
diff < 86400 && Math.floor( diff / 3600 ) + " hours ago") ||
|
23
|
+
day_diff == 1 && "Yesterday" ||
|
24
|
+
day_diff < 7 && day_diff + " days ago" ||
|
25
|
+
day_diff < 31 && Math.ceil( day_diff / 7 ) + " weeks ago";
|
26
|
+
}
|
27
|
+
|
28
|
+
// If jQuery is included in the page, adds a jQuery plugin to handle it as well
|
29
|
+
if ( typeof jQuery != "undefined" )
|
30
|
+
jQuery.fn.prettyDate = function(){
|
31
|
+
return this.each(function(){
|
32
|
+
var date = prettyDate(this.title);
|
33
|
+
if (date)
|
34
|
+
jQuery(this).text(date);
|
35
|
+
});
|
36
|
+
};
|
@@ -0,0 +1,421 @@
|
|
1
|
+
var Attacklab=Attacklab||{};
|
2
|
+
Attacklab.showdown=Attacklab.showdown||{};
|
3
|
+
Attacklab.showdown.converter=function(){
|
4
|
+
this.obfuscation;
|
5
|
+
var _1;
|
6
|
+
var _2;
|
7
|
+
var _3;
|
8
|
+
var _4=0;
|
9
|
+
this.makeHtml=function(_5){
|
10
|
+
_1=new Array();
|
11
|
+
_2=new Array();
|
12
|
+
_3=new Array();
|
13
|
+
_5=_5.replace(/~/g,"~T");
|
14
|
+
_5=_5.replace(/\$/g,"~D");
|
15
|
+
_5=_5.replace(/\r\n/g,"\n");
|
16
|
+
_5=_5.replace(/\r/g,"\n");
|
17
|
+
_5="\n\n"+_5+"\n\n";
|
18
|
+
_5=_6(_5);
|
19
|
+
_5=_5.replace(/^[ \t]+$/mg,"");
|
20
|
+
_5=_7(_5);
|
21
|
+
_5=_8(_5);
|
22
|
+
_5=_9(_5);
|
23
|
+
_5=_a(_5);
|
24
|
+
_5=_5.replace(/~D/g,"$$");
|
25
|
+
_5=_5.replace(/~T/g,"~");
|
26
|
+
return _5;
|
27
|
+
};
|
28
|
+
var _8=function(_b){
|
29
|
+
var _b=_b.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|\Z)/gm,function(_c,m1,m2,m3,m4){
|
30
|
+
m1=m1.toLowerCase();
|
31
|
+
_1[m1]=_11(m2);
|
32
|
+
if(m3){
|
33
|
+
return m3+m4;
|
34
|
+
}else{
|
35
|
+
if(m4){
|
36
|
+
_2[m1]=m4.replace(/"/g,""");
|
37
|
+
}
|
38
|
+
}
|
39
|
+
return "";
|
40
|
+
});
|
41
|
+
return _b;
|
42
|
+
};
|
43
|
+
var _7=function(_12){
|
44
|
+
_12=_12.replace(/\n/g,"\n\n");
|
45
|
+
var _13="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del";
|
46
|
+
var _14="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math";
|
47
|
+
_12=_12.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,_15);
|
48
|
+
_12=_12.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,_15);
|
49
|
+
_12=_12.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,_15);
|
50
|
+
_12=_12.replace(/(\n\n[ ]{0,3}<!(--[^\r]*?--\s*)+>[ \t]*(?=\n{2,}))/g,_15);
|
51
|
+
_12=_12.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,_15);
|
52
|
+
_12=_12.replace(/\n\n/g,"\n");
|
53
|
+
return _12;
|
54
|
+
};
|
55
|
+
var _15=function(_16,m1){
|
56
|
+
var _18=m1;
|
57
|
+
_18=_18.replace(/\n\n/g,"\n");
|
58
|
+
_18=_18.replace(/^\n/,"");
|
59
|
+
_18=_18.replace(/\n+$/g,"");
|
60
|
+
_18="\n\n~K"+(_3.push(_18)-1)+"K\n\n";
|
61
|
+
return _18;
|
62
|
+
};
|
63
|
+
var _9=function(_19){
|
64
|
+
_19=_1a(_19);
|
65
|
+
var key=_1c("<hr />");
|
66
|
+
_19=_19.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,key);
|
67
|
+
_19=_19.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm,key);
|
68
|
+
_19=_19.replace(/^[ ]{0,2}([ ]?\_[ ]?){3,}[ \t]*$/gm,key);
|
69
|
+
_19=_1d(_19);
|
70
|
+
_19=_1e(_19);
|
71
|
+
_19=_1f(_19);
|
72
|
+
_19=_7(_19);
|
73
|
+
_19=_20(_19);
|
74
|
+
return _19;
|
75
|
+
};
|
76
|
+
var _21=function(_22){
|
77
|
+
_22=_23(_22);
|
78
|
+
_22=_24(_22);
|
79
|
+
_22=_25(_22);
|
80
|
+
_22=_26(_22);
|
81
|
+
_22=_27(_22);
|
82
|
+
_22=_28(_22);
|
83
|
+
_22=_11(_22);
|
84
|
+
_22=_29(_22);
|
85
|
+
_22=_22.replace(/ +\n/g," <br />\n");
|
86
|
+
return _22;
|
87
|
+
};
|
88
|
+
var _24=function(_2a){
|
89
|
+
var _2b=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--.*?--\s*)+>)/gi;
|
90
|
+
_2a=_2a.replace(_2b,function(_2c){
|
91
|
+
var tag=_2c.replace(/(.)<\/?code>(?=.)/g,"$1`");
|
92
|
+
tag=_2e(tag,"\\`*_");
|
93
|
+
return tag;
|
94
|
+
});
|
95
|
+
return _2a;
|
96
|
+
};
|
97
|
+
var _27=function(_2f){
|
98
|
+
_2f=_2f.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,_30);
|
99
|
+
_2f=_2f.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,_30);
|
100
|
+
_2f=_2f.replace(/(\[([^\[\]]+)\])()()()()()/g,_30);
|
101
|
+
return _2f;
|
102
|
+
};
|
103
|
+
var _30=function(_31,m1,m2,m3,m4,m5,m6,m7){
|
104
|
+
if(m7==undefined){
|
105
|
+
m7="";
|
106
|
+
}
|
107
|
+
var _39=m1;
|
108
|
+
var _3a=m2;
|
109
|
+
var _3b=m3.toLowerCase();
|
110
|
+
var url=m4;
|
111
|
+
var _3d=m7;
|
112
|
+
if(url==""){
|
113
|
+
if(_3b==""){
|
114
|
+
_3b=_3a.toLowerCase().replace(/ ?\n/g," ");
|
115
|
+
}
|
116
|
+
url="#"+_3b;
|
117
|
+
if(_1[_3b]!=undefined){
|
118
|
+
url=_1[_3b];
|
119
|
+
if(_2[_3b]!=undefined){
|
120
|
+
_3d=_2[_3b];
|
121
|
+
}
|
122
|
+
}else{
|
123
|
+
if(_39.search(/\(\s*\)$/m)>-1){
|
124
|
+
url="";
|
125
|
+
}else{
|
126
|
+
return _39;
|
127
|
+
}
|
128
|
+
}
|
129
|
+
}
|
130
|
+
url=_2e(url,"*_");
|
131
|
+
var _3e="<a href=\""+url+"\"";
|
132
|
+
if(_3d!=""){
|
133
|
+
_3d=_3d.replace(/"/g,""");
|
134
|
+
_3d=_2e(_3d,"*_");
|
135
|
+
_3e+=" title=\""+_3d+"\"";
|
136
|
+
}
|
137
|
+
_3e+=">"+_3a+"</a>";
|
138
|
+
return _3e;
|
139
|
+
};
|
140
|
+
var _26=function(_3f){
|
141
|
+
_3f=_3f.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,_40);
|
142
|
+
_3f=_3f.replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,_40);
|
143
|
+
return _3f;
|
144
|
+
};
|
145
|
+
var _40=function(_41,m1,m2,m3,m4,m5,m6,m7){
|
146
|
+
var _49=m1;
|
147
|
+
var _4a=m2;
|
148
|
+
var _4b=m3.toLowerCase();
|
149
|
+
var url=m4;
|
150
|
+
var _4d=m7;
|
151
|
+
if(!_4d){
|
152
|
+
_4d="";
|
153
|
+
}
|
154
|
+
if(url==""){
|
155
|
+
if(_4b==""){
|
156
|
+
_4b=_4a.toLowerCase().replace(/ ?\n/g," ");
|
157
|
+
}
|
158
|
+
url="#"+_4b;
|
159
|
+
if(_1[_4b]!=undefined){
|
160
|
+
url=_1[_4b];
|
161
|
+
if(_2[_4b]!=undefined){
|
162
|
+
_4d=_2[_4b];
|
163
|
+
}
|
164
|
+
}else{
|
165
|
+
return _49;
|
166
|
+
}
|
167
|
+
}
|
168
|
+
_4a=_4a.replace(/"/g,""");
|
169
|
+
url=_2e(url,"*_");
|
170
|
+
var _4e="<img src=\""+url+"\" alt=\""+_4a+"\"";
|
171
|
+
_4d=_4d.replace(/"/g,""");
|
172
|
+
_4d=_2e(_4d,"*_");
|
173
|
+
_4e+=" title=\""+_4d+"\"";
|
174
|
+
_4e+=" />";
|
175
|
+
return _4e;
|
176
|
+
};
|
177
|
+
var _1a=function(_4f){
|
178
|
+
_4f=_4f.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,function(_50,m1){
|
179
|
+
return _1c("<h1>"+_21(m1)+"</h1>");
|
180
|
+
});
|
181
|
+
_4f=_4f.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(_52,m1){
|
182
|
+
return _1c("<h2>"+_21(m1)+"</h2>");
|
183
|
+
});
|
184
|
+
_4f=_4f.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(_54,m1,m2){
|
185
|
+
var _57=m1.length;
|
186
|
+
return _1c("<h"+_57+">"+_21(m2)+"</h"+_57+">");
|
187
|
+
});
|
188
|
+
return _4f;
|
189
|
+
};
|
190
|
+
var _58;
|
191
|
+
var _1d=function(_59){
|
192
|
+
_59+="~0";
|
193
|
+
var _5a=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;
|
194
|
+
if(_4){
|
195
|
+
_59=_59.replace(_5a,function(_5b,m1,m2){
|
196
|
+
var _5e=m1;
|
197
|
+
var _5f=(m2.search(/[*+-]/g)>-1)?"ul":"ol";
|
198
|
+
_5e=_5e.replace(/\n{2,}/g,"\n\n\n");
|
199
|
+
var _60=_58(_5e);
|
200
|
+
_60=_60.replace(/\s+$/,"");
|
201
|
+
_60="<"+_5f+">"+_60+"</"+_5f+">\n";
|
202
|
+
return _60;
|
203
|
+
});
|
204
|
+
}else{
|
205
|
+
_5a=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g;
|
206
|
+
_59=_59.replace(_5a,function(_61,m1,m2,m3){
|
207
|
+
var _65=m1;
|
208
|
+
var _66=m2;
|
209
|
+
var _67=(m3.search(/[*+-]/g)>-1)?"ul":"ol";
|
210
|
+
var _66=_66.replace(/\n{2,}/g,"\n\n\n");
|
211
|
+
var _68=_58(_66);
|
212
|
+
_68=_65+"<"+_67+">\n"+_68+"</"+_67+">\n";
|
213
|
+
return _68;
|
214
|
+
});
|
215
|
+
}
|
216
|
+
_59=_59.replace(/~0/,"");
|
217
|
+
return _59;
|
218
|
+
};
|
219
|
+
_58=function(_69){
|
220
|
+
_4++;
|
221
|
+
_69=_69.replace(/\n{2,}$/,"\n");
|
222
|
+
_69+="~0";
|
223
|
+
_69=_69.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm,function(_6a,m1,m2,m3,m4){
|
224
|
+
var _6f=m4;
|
225
|
+
var _70=m1;
|
226
|
+
var _71=m2;
|
227
|
+
if(_70||(_6f.search(/\n{2,}/)>-1)){
|
228
|
+
_6f=_9(_72(_6f));
|
229
|
+
}else{
|
230
|
+
_6f=_1d(_72(_6f));
|
231
|
+
_6f=_6f.replace(/\n$/,"");
|
232
|
+
_6f=_21(_6f);
|
233
|
+
}
|
234
|
+
return "<li>"+_6f+"</li>\n";
|
235
|
+
});
|
236
|
+
_69=_69.replace(/~0/g,"");
|
237
|
+
_4--;
|
238
|
+
return _69;
|
239
|
+
};
|
240
|
+
var _1e=function(_73){
|
241
|
+
_73+="~0";
|
242
|
+
_73=_73.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(_74,m1,m2){
|
243
|
+
var _77=m1;
|
244
|
+
var _78=m2;
|
245
|
+
_77=_79(_72(_77));
|
246
|
+
_77=_6(_77);
|
247
|
+
_77=_77.replace(/^\n+/g,"");
|
248
|
+
_77=_77.replace(/\n+$/g,"");
|
249
|
+
_77="<pre><code>"+_77+"\n</code></pre>";
|
250
|
+
return _1c(_77)+_78;
|
251
|
+
});
|
252
|
+
_73=_73.replace(/~0/,"");
|
253
|
+
return _73;
|
254
|
+
};
|
255
|
+
var _1c=function(_7a){
|
256
|
+
_7a=_7a.replace(/(^\n+|\n+$)/g,"");
|
257
|
+
return "\n\n~K"+(_3.push(_7a)-1)+"K\n\n";
|
258
|
+
};
|
259
|
+
var _23=function(_7b){
|
260
|
+
_7b=_7b.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(_7c,m1,m2,m3,m4){
|
261
|
+
var c=m3;
|
262
|
+
c=c.replace(/^([ \t]*)/g,"");
|
263
|
+
c=c.replace(/[ \t]*$/g,"");
|
264
|
+
c=_79(c);
|
265
|
+
return m1+"<code>"+c+"</code>";
|
266
|
+
});
|
267
|
+
return _7b;
|
268
|
+
};
|
269
|
+
var _79=function(_82){
|
270
|
+
_82=_82.replace(/&/g,"&");
|
271
|
+
_82=_82.replace(/</g,"<");
|
272
|
+
_82=_82.replace(/>/g,">");
|
273
|
+
_82=_2e(_82,"*_{}[]\\",false);
|
274
|
+
return _82;
|
275
|
+
};
|
276
|
+
var _29=function(_83){
|
277
|
+
_83=_83.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"<strong>$2</strong>");
|
278
|
+
_83=_83.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"<em>$2</em>");
|
279
|
+
return _83;
|
280
|
+
};
|
281
|
+
this.hidetable;
|
282
|
+
var _1f=function(_84){
|
283
|
+
_84=_84.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(_85,m1){
|
284
|
+
var bq=m1;
|
285
|
+
bq=bq.replace(/^[ \t]*>[ \t]?/gm,"~0");
|
286
|
+
bq=bq.replace(/~0/g,"");
|
287
|
+
bq=bq.replace(/^[ \t]+$/gm,"");
|
288
|
+
bq=_9(bq);
|
289
|
+
bq=bq.replace(/(^|\n)/g,"$1 ");
|
290
|
+
bq=bq.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(_88,m1){
|
291
|
+
var pre=m1;
|
292
|
+
pre=pre.replace(/^ /mg,"~0");
|
293
|
+
pre=pre.replace(/~0/g,"");
|
294
|
+
return pre;
|
295
|
+
});
|
296
|
+
return _1c("<blockquote>\n"+bq+"\n</blockquote>");
|
297
|
+
});
|
298
|
+
return _84;
|
299
|
+
};
|
300
|
+
var _20=function(_8b){
|
301
|
+
_8b=_8b.replace(/^\n+/g,"");
|
302
|
+
_8b=_8b.replace(/\n+$/g,"");
|
303
|
+
var _8c=_8b.split(/\n{2,}/g);
|
304
|
+
var _8d=new Array();
|
305
|
+
var end=_8c.length;
|
306
|
+
for(var i=0;i<end;i++){
|
307
|
+
var str=_8c[i];
|
308
|
+
if(str.search(/~K(\d+)K/g)>=0){
|
309
|
+
_8d.push(str);
|
310
|
+
}else{
|
311
|
+
if(str.search(/\S/)>=0){
|
312
|
+
str=_21(str);
|
313
|
+
str=str.replace(/^([ \t]*)/g,"<p>");
|
314
|
+
str+="</p>";
|
315
|
+
_8d.push(str);
|
316
|
+
}
|
317
|
+
}
|
318
|
+
}
|
319
|
+
end=_8d.length;
|
320
|
+
for(var i=0;i<end;i++){
|
321
|
+
while(_8d[i].search(/~K(\d+)K/)>=0){
|
322
|
+
var _91=_3[RegExp.$1];
|
323
|
+
_91=_91.replace(/\$/g,"$$$$");
|
324
|
+
_8d[i]=_8d[i].replace(/~K\d+K/,_91);
|
325
|
+
}
|
326
|
+
}
|
327
|
+
return _8d.join("\n\n");
|
328
|
+
};
|
329
|
+
var _11=function(_92){
|
330
|
+
_92=_92.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&");
|
331
|
+
_92=_92.replace(/<(?![a-z\/?\$!])/gi,"<");
|
332
|
+
return _92;
|
333
|
+
};
|
334
|
+
var _25=function(_93){
|
335
|
+
_93=_93.replace(/\\(\\)/g,_94);
|
336
|
+
_93=_93.replace(/\\([`*_{}\[\]()>#+-.!])/g,_94);
|
337
|
+
return _93;
|
338
|
+
};
|
339
|
+
var _28=function(_95){
|
340
|
+
_95=_95.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,"<a href=\"$1\">$1</a>");
|
341
|
+
_95=_95.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,function(_96,m1){
|
342
|
+
return _98(_a(m1));
|
343
|
+
});
|
344
|
+
return _95;
|
345
|
+
};
|
346
|
+
var _98=function(_99){
|
347
|
+
function char2hex(ch){
|
348
|
+
var _9b="0123456789ABCDEF";
|
349
|
+
var dec=ch.charCodeAt(0);
|
350
|
+
return (_9b.charAt(dec>>4)+_9b.charAt(dec&15));
|
351
|
+
}
|
352
|
+
var _9d=[function(ch){
|
353
|
+
return "&#"+ch.charCodeAt(0)+";";
|
354
|
+
},function(ch){
|
355
|
+
return "&#x"+char2hex(ch)+";";
|
356
|
+
},function(ch){
|
357
|
+
return ch;
|
358
|
+
}];
|
359
|
+
_99="mailto:"+_99;
|
360
|
+
_99=_99.replace(/./g,function(ch){
|
361
|
+
if(ch=="@"){
|
362
|
+
ch=_9d[Math.floor(Math.random()*2)](ch);
|
363
|
+
}else{
|
364
|
+
if(ch!=":"){
|
365
|
+
var r=Math.random();
|
366
|
+
ch=(r>0.9?_9d[2](ch):r>0.45?_9d[1](ch):_9d[0](ch));
|
367
|
+
}
|
368
|
+
}
|
369
|
+
return ch;
|
370
|
+
});
|
371
|
+
_99="<a href=\""+_99+"\">"+_99+"</a>";
|
372
|
+
_99=_99.replace(/">.+:/g,"\">");
|
373
|
+
return _99;
|
374
|
+
};
|
375
|
+
var _a=function(_a3){
|
376
|
+
_a3=_a3.replace(/~E(\d+)E/g,function(_a4,m1){
|
377
|
+
var _a6=parseInt(m1);
|
378
|
+
return String.fromCharCode(_a6);
|
379
|
+
});
|
380
|
+
return _a3;
|
381
|
+
};
|
382
|
+
var _72=function(_a7){
|
383
|
+
_a7=_a7.replace(/^(\t|[ ]{1,4})/gm,"~0");
|
384
|
+
_a7=_a7.replace(/~0/g,"");
|
385
|
+
return _a7;
|
386
|
+
};
|
387
|
+
var _6=function(_a8){
|
388
|
+
_a8=_a8.replace(/\t(?=\t)/g," ");
|
389
|
+
_a8=_a8.replace(/\t/g,"~A~B");
|
390
|
+
_a8=_a8.replace(/~B(.+?)~A/g,function(_a9,m1,m2){
|
391
|
+
var _ac=m1;
|
392
|
+
var _ad=4-_ac.length%4;
|
393
|
+
for(var i=0;i<_ad;i++){
|
394
|
+
_ac+=" ";
|
395
|
+
}
|
396
|
+
return _ac;
|
397
|
+
});
|
398
|
+
_a8=_a8.replace(/~A/g," ");
|
399
|
+
_a8=_a8.replace(/~B/g,"");
|
400
|
+
return _a8;
|
401
|
+
};
|
402
|
+
var _2e=function(_af,_b0,_b1){
|
403
|
+
var _b2="(["+_b0.replace(/([\[\]\\])/g,"\\$1")+"])";
|
404
|
+
if(_b1){
|
405
|
+
_b2="\\\\"+_b2;
|
406
|
+
}
|
407
|
+
var _b3=new RegExp(_b2,"g");
|
408
|
+
_af=_af.replace(_b3,_94);
|
409
|
+
return _af;
|
410
|
+
};
|
411
|
+
var _94=function(_b4,m1){
|
412
|
+
var _b6=m1.charCodeAt(0);
|
413
|
+
return "~E"+_b6+"E";
|
414
|
+
};
|
415
|
+
this.obfuscation;
|
416
|
+
};
|
417
|
+
var Showdown=Attacklab.showdown;
|
418
|
+
if(Attacklab.fileLoaded){
|
419
|
+
Attacklab.fileLoaded("showdown.js");
|
420
|
+
}
|
421
|
+
|