redcarpet 3.3.2 → 3.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/COPYING +17 -11
- data/Gemfile +2 -2
- data/README.markdown +66 -48
- data/ext/redcarpet/autolink.c +24 -12
- data/ext/redcarpet/autolink.h +17 -11
- data/ext/redcarpet/buffer.c +18 -11
- data/ext/redcarpet/buffer.h +17 -12
- data/ext/redcarpet/houdini.h +22 -0
- data/ext/redcarpet/houdini_href_e.c +27 -11
- data/ext/redcarpet/houdini_html_e.c +22 -1
- data/ext/redcarpet/html.c +52 -19
- data/ext/redcarpet/html.h +18 -13
- data/ext/redcarpet/html_blocks.h +68 -70
- data/ext/redcarpet/html_smartypants.c +47 -20
- data/ext/redcarpet/markdown.c +22 -20
- data/ext/redcarpet/markdown.h +17 -12
- data/ext/redcarpet/rc_markdown.c +35 -13
- data/ext/redcarpet/rc_render.c +51 -17
- data/ext/redcarpet/redcarpet.h +22 -0
- data/ext/redcarpet/stack.c +22 -0
- data/ext/redcarpet/stack.h +22 -0
- data/lib/redcarpet.rb +1 -1
- data/lib/redcarpet/cli.rb +1 -1
- data/lib/redcarpet/compat.rb +0 -2
- data/lib/redcarpet/render_strip.rb +13 -1
- data/redcarpet.gemspec +5 -4
- data/test/custom_render_test.rb +40 -1
- data/test/html5_test.rb +51 -38
- data/test/html_render_test.rb +92 -59
- data/test/html_toc_render_test.rb +41 -4
- data/test/markdown_test.rb +234 -177
- data/test/redcarpet_bin_test.rb +2 -2
- data/test/safe_render_test.rb +5 -6
- data/test/smarty_html_test.rb +19 -13
- data/test/smarty_pants_test.rb +10 -0
- data/test/stripdown_render_test.rb +38 -9
- data/test/test_helper.rb +17 -3
- metadata +24 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3e6ea78031a1e40620168cd57fcbfae06bec5bafabc8f6e600adc552a4fe5b40
|
4
|
+
data.tar.gz: 658dd33e836daa11effa88e0491d09387963ea349751efd278e9fbdac7026066
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b17b0208c25d4e8566fb4a154d0f66e778b702abcf58d1d1227fa2510be421c7496e20fd6402066adba3485778e935b46aff73fd412802eedb89e44470a7ad94
|
7
|
+
data.tar.gz: 1e1c8dd559979b8bd5f4de2d20e1127b2a964c03a267133c3d9a3703f71bce44a2f4dc2efdb0dc0cc331e0ab779bfad23e9b62af0ffc4ee9078896376bd86865
|
data/COPYING
CHANGED
@@ -1,14 +1,20 @@
|
|
1
1
|
Copyright (c) 2009, Natacha Porté
|
2
|
-
Copyright (c)
|
2
|
+
Copyright (c) 2015, Vicent Marti
|
3
3
|
|
4
|
-
Permission
|
5
|
-
|
6
|
-
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
7
10
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
OR
|
11
|
+
The above copyright notice and this permission notice shall be included in
|
12
|
+
all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
THE SOFTWARE.
|
data/Gemfile
CHANGED
data/README.markdown
CHANGED
@@ -2,6 +2,8 @@ Redcarpet is written with sugar, spice and everything nice
|
|
2
2
|
============================================================
|
3
3
|
|
4
4
|
[![Build Status](https://travis-ci.org/vmg/redcarpet.svg?branch=master)](https://travis-ci.org/vmg/redcarpet)
|
5
|
+
[![Dependency Status](https://www.versioneye.com/ruby/redcarpet/badge.svg)](https://www.versioneye.com/ruby/redcarpet)
|
6
|
+
[![Help Contribute to Open Source](https://www.codetriage.com/vmg/redcarpet/badges/users.svg)](https://www.codetriage.com/vmg/redcarpet)
|
5
7
|
|
6
8
|
Redcarpet is a Ruby library for Markdown processing that smells like
|
7
9
|
butterflies and popcorn.
|
@@ -24,7 +26,7 @@ Starting with Redcarpet 3.0, the minimum required Ruby version is 1.9.2 (or Rubi
|
|
24
26
|
|
25
27
|
$ [sudo] gem install redcarpet
|
26
28
|
|
27
|
-
If you need to use it with Ruby 1.8.7, you will
|
29
|
+
If you need to use it with Ruby 1.8.7, you will have to stick with 2.3.0:
|
28
30
|
|
29
31
|
$ [sudo] gem install redcarpet -v 2.3.0
|
30
32
|
|
@@ -44,10 +46,10 @@ output.
|
|
44
46
|
The `Redcarpet::Markdown` object is encouraged to be instantiated once with the
|
45
47
|
required settings, and reused between parses.
|
46
48
|
|
47
|
-
|
49
|
+
~~~~ ruby
|
48
50
|
# Initializes a Markdown parser
|
49
51
|
markdown = Redcarpet::Markdown.new(renderer, extensions = {})
|
50
|
-
|
52
|
+
~~~~
|
51
53
|
|
52
54
|
Here, the `renderer` variable refers to a renderer object, inheriting
|
53
55
|
from `Redcarpet::Render::Base`. If the given object has not been
|
@@ -58,10 +60,10 @@ Unlike in the RedCloth API, the text to render is passed as an argument
|
|
58
60
|
and not stored inside the `Markdown` instance, to encourage reusability.
|
59
61
|
Example:
|
60
62
|
|
61
|
-
|
63
|
+
~~~~ ruby
|
62
64
|
markdown.render("This is *bongos*, indeed.")
|
63
65
|
# => "<p>This is <em>bongos</em>, indeed.</p>"
|
64
|
-
|
66
|
+
~~~~
|
65
67
|
|
66
68
|
You can also specify a hash containing the Markdown extensions which the
|
67
69
|
parser will identify. The following extensions are accepted:
|
@@ -83,7 +85,7 @@ but starting with `www` are also handled.
|
|
83
85
|
|
84
86
|
* `:disable_indented_code_blocks`: do not parse usual markdown
|
85
87
|
code blocks. Markdown converts text with four spaces at
|
86
|
-
the front of each line to code blocks. This
|
88
|
+
the front of each line to code blocks. This option
|
87
89
|
prevents it from doing so. Recommended to use
|
88
90
|
with `fenced_code_blocks: true`.
|
89
91
|
|
@@ -118,9 +120,9 @@ within the document (e.g. `[^1]: This is a footnote.`).
|
|
118
120
|
|
119
121
|
Example:
|
120
122
|
|
121
|
-
|
123
|
+
~~~~ ruby
|
122
124
|
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true)
|
123
|
-
|
125
|
+
~~~~
|
124
126
|
|
125
127
|
Darling, I packed you a couple renderers for lunch
|
126
128
|
--------------------------------------------------
|
@@ -135,9 +137,9 @@ All the rendering flags that previously applied only to HTML output have
|
|
135
137
|
now been moved to the `Redcarpet::Render::HTML` class, and may be enabled when
|
136
138
|
instantiating the renderer:
|
137
139
|
|
138
|
-
|
140
|
+
~~~~ ruby
|
139
141
|
Redcarpet::Render::HTML.new(render_options = {})
|
140
|
-
|
142
|
+
~~~~
|
141
143
|
|
142
144
|
Initializes an HTML renderer. The following flags are available:
|
143
145
|
|
@@ -159,7 +161,7 @@ safe.
|
|
159
161
|
* `:with_toc_data`: add HTML anchors to each header in the output HTML,
|
160
162
|
to allow linking to each section.
|
161
163
|
|
162
|
-
* `:hard_wrap`: insert HTML `<br>` tags inside
|
164
|
+
* `:hard_wrap`: insert HTML `<br>` tags inside paragraphs where the original
|
163
165
|
Markdown document had newlines (by default, Markdown ignores these newlines).
|
164
166
|
|
165
167
|
* `:xhtml`: output XHTML-conformant tags. This option is always enabled in the
|
@@ -171,9 +173,9 @@ Markdown document had newlines (by default, Markdown ignores these newlines).
|
|
171
173
|
|
172
174
|
Example:
|
173
175
|
|
174
|
-
|
176
|
+
~~~~ ruby
|
175
177
|
renderer = Redcarpet::Render::HTML.new(no_links: true, hard_wrap: true)
|
176
|
-
|
178
|
+
~~~~
|
177
179
|
|
178
180
|
|
179
181
|
The `HTML` renderer has an alternate version, `Redcarpet::Render::HTML_TOC`,
|
@@ -181,12 +183,21 @@ which will output a table of contents in HTML based on the headers of the
|
|
181
183
|
Markdown document.
|
182
184
|
|
183
185
|
When instantiating this render object, you can optionally pass a `nesting_level`
|
184
|
-
option which takes an integer and allows you to make it render only
|
185
|
-
|
186
|
+
option which takes an integer or a range and allows you to make it render only
|
187
|
+
headers at certain levels.
|
186
188
|
|
187
|
-
|
188
|
-
|
189
|
-
|
189
|
+
Redcarpet also includes a plaintext renderer, `Redcarpet::Render::StripDown`, that
|
190
|
+
strips out all the formatting:
|
191
|
+
|
192
|
+
~~~~ ruby
|
193
|
+
require 'redcarpet'
|
194
|
+
require 'redcarpet/render_strip'
|
195
|
+
|
196
|
+
markdown = Redcarpet::Markdown.new(Redcarpet::Render::StripDown)
|
197
|
+
|
198
|
+
markdown.render("**This** _is_ an [example](http://example.org/).")
|
199
|
+
# => "This is an example (http://example.org/)."
|
200
|
+
~~~~
|
190
201
|
|
191
202
|
|
192
203
|
And you can even cook your own
|
@@ -195,25 +206,26 @@ And you can even cook your own
|
|
195
206
|
Custom renderers are created by inheriting from an existing renderer. The
|
196
207
|
built-in renderers, `HTML` and `XHTML` may be extended as such:
|
197
208
|
|
198
|
-
|
199
|
-
#
|
200
|
-
class
|
201
|
-
def
|
202
|
-
|
209
|
+
~~~~ ruby
|
210
|
+
# Create a custom renderer that sets a custom class for block-quotes.
|
211
|
+
class CustomRender < Redcarpet::Render::HTML
|
212
|
+
def block_quote(quote)
|
213
|
+
%(<blockquote class="my-custom-class">#{quote}</blockquote>)
|
203
214
|
end
|
204
215
|
end
|
205
216
|
|
206
|
-
markdown = Redcarpet::Markdown.new(
|
207
|
-
|
217
|
+
markdown = Redcarpet::Markdown.new(CustomRender, fenced_code_blocks: true)
|
218
|
+
~~~~
|
208
219
|
|
209
|
-
But new renderers can also be created from scratch
|
210
|
-
|
220
|
+
But new renderers can also be created from scratch by extending the abstract
|
221
|
+
base class `Redcarpet::Render::Base` (see `lib/redcarpet/render_man.rb` for
|
222
|
+
an example implementation of a Manpage renderer):
|
211
223
|
|
212
|
-
|
224
|
+
~~~~ ruby
|
213
225
|
class ManPage < Redcarpet::Render::Base
|
214
226
|
# you get the drill -- keep going from here
|
215
227
|
end
|
216
|
-
|
228
|
+
~~~~
|
217
229
|
|
218
230
|
The following instance methods may be implemented by the renderer:
|
219
231
|
|
@@ -301,7 +313,7 @@ or after the rendering process begins:
|
|
301
313
|
* postprocess(full_document)
|
302
314
|
|
303
315
|
You can look at
|
304
|
-
["How to extend the Redcarpet 2 Markdown library?"](http://dev.af83.com/2012/02/27/howto-extend-the-redcarpet2-markdown-lib.html)
|
316
|
+
["How to extend the Redcarpet 2 Markdown library?"](https://web.archive.org/web/20170505231254/http://dev.af83.com/2012/02/27/howto-extend-the-redcarpet2-markdown-lib.html)
|
305
317
|
for some more explanations.
|
306
318
|
|
307
319
|
Also, now our Pants are much smarter
|
@@ -326,7 +338,7 @@ end
|
|
326
338
|
|
327
339
|
# Standalone
|
328
340
|
Redcarpet::Render::SmartyPants.render("<p>Oh SmartyPants, you're so crazy...</p>")
|
329
|
-
|
341
|
+
~~~~
|
330
342
|
|
331
343
|
SmartyPants works on top of already-rendered HTML, and will ignore replacements
|
332
344
|
inside the content of HTML tags and inside specific HTML blocks such as
|
@@ -351,16 +363,16 @@ renderer-independent, the results will be completely unreliable!
|
|
351
363
|
Still, if major forces (let's say, tornadoes or other natural disasters) force you
|
352
364
|
to keep a Markdown-compatibility layer, Redcarpet also supports this:
|
353
365
|
|
354
|
-
|
366
|
+
~~~~ ruby
|
355
367
|
require 'redcarpet/compat'
|
356
|
-
|
368
|
+
~~~~
|
357
369
|
|
358
370
|
Requiring the compatibility library will declare a `Markdown` class with the
|
359
371
|
classical RedCloth API, e.g.
|
360
372
|
|
361
|
-
|
373
|
+
~~~~ ruby
|
362
374
|
Markdown.new('this is my text').to_html
|
363
|
-
|
375
|
+
~~~~
|
364
376
|
|
365
377
|
This class renders 100% standards compliant Markdown with 0 extensions. Nada.
|
366
378
|
Don't even try to enable extensions with a compatibility layer, because
|
@@ -372,16 +384,22 @@ monkeypatches the Markdown class, you're a terrible human being. Just saying.
|
|
372
384
|
Boring legal stuff
|
373
385
|
------------------
|
374
386
|
|
375
|
-
Copyright (c) 2011-
|
376
|
-
|
377
|
-
Permission
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
387
|
+
Copyright (c) 2011-2016, Vicent Martí
|
388
|
+
|
389
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
390
|
+
of this software and associated documentation files (the "Software"), to deal
|
391
|
+
in the Software without restriction, including without limitation the rights
|
392
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
393
|
+
copies of the Software, and to permit persons to whom the Software is
|
394
|
+
furnished to do so, subject to the following conditions:
|
395
|
+
|
396
|
+
The above copyright notice and this permission notice shall be included in
|
397
|
+
all copies or substantial portions of the Software.
|
398
|
+
|
399
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
400
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
401
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
402
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
403
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
404
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
405
|
+
THE SOFTWARE.
|
data/ext/redcarpet/autolink.c
CHANGED
@@ -1,17 +1,23 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) 2015, Vicent Marti
|
3
3
|
*
|
4
|
-
* Permission
|
5
|
-
*
|
6
|
-
*
|
4
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
* of this software and associated documentation files (the "Software"), to deal
|
6
|
+
* in the Software without restriction, including without limitation the rights
|
7
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
* copies of the Software, and to permit persons to whom the Software is
|
9
|
+
* furnished to do so, subject to the following conditions:
|
7
10
|
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
* OR
|
11
|
+
* The above copyright notice and this permission notice shall be included in
|
12
|
+
* all copies or substantial portions of the Software.
|
13
|
+
*
|
14
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
* THE SOFTWARE.
|
15
21
|
*/
|
16
22
|
|
17
23
|
#include "buffer.h"
|
@@ -288,9 +294,15 @@ sd_autolink__url(
|
|
288
294
|
if (link_end == 0)
|
289
295
|
return 0;
|
290
296
|
|
297
|
+
/**
|
298
|
+
* In certain cases, we may refer to a link at the end of a
|
299
|
+
* sentence so the period should not be part of the URL.
|
300
|
+
*/
|
301
|
+
if (data[link_end - 1] == '.')
|
302
|
+
link_end--;
|
303
|
+
|
291
304
|
bufput(link, data - rewind, link_end + rewind);
|
292
305
|
*rewind_p = rewind;
|
293
306
|
|
294
307
|
return link_end;
|
295
308
|
}
|
296
|
-
|
data/ext/redcarpet/autolink.h
CHANGED
@@ -1,17 +1,23 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) 2015, Vicent Marti
|
3
3
|
*
|
4
|
-
* Permission
|
5
|
-
*
|
6
|
-
*
|
4
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
* of this software and associated documentation files (the "Software"), to deal
|
6
|
+
* in the Software without restriction, including without limitation the rights
|
7
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
* copies of the Software, and to permit persons to whom the Software is
|
9
|
+
* furnished to do so, subject to the following conditions:
|
7
10
|
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
* OR
|
11
|
+
* The above copyright notice and this permission notice shall be included in
|
12
|
+
* all copies or substantial portions of the Software.
|
13
|
+
*
|
14
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
* THE SOFTWARE.
|
15
21
|
*/
|
16
22
|
|
17
23
|
#ifndef AUTOLINK_H__
|
data/ext/redcarpet/buffer.c
CHANGED
@@ -1,21 +1,28 @@
|
|
1
1
|
/*
|
2
2
|
* Copyright (c) 2008, Natacha Porté
|
3
|
-
* Copyright (c)
|
3
|
+
* Copyright (c) 2015, Vicent Marti
|
4
4
|
*
|
5
|
-
* Permission
|
6
|
-
*
|
7
|
-
*
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
10
|
+
* furnished to do so, subject to the following conditions:
|
8
11
|
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
15
|
-
* OR
|
12
|
+
* The above copyright notice and this permission notice shall be included in
|
13
|
+
* all copies or substantial portions of the Software.
|
14
|
+
*
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
* THE SOFTWARE.
|
16
22
|
*/
|
17
23
|
|
18
24
|
#define BUFFER_MAX_ALLOC_SIZE (1024 * 1024 * 16) //16mb
|
25
|
+
#define __USE_MINGW_ANSI_STDIO 1
|
19
26
|
|
20
27
|
#include "buffer.h"
|
21
28
|
|
data/ext/redcarpet/buffer.h
CHANGED
@@ -1,18 +1,24 @@
|
|
1
1
|
/*
|
2
2
|
* Copyright (c) 2008, Natacha Porté
|
3
|
-
* Copyright (c)
|
3
|
+
* Copyright (c) 2015, Vicent Marti
|
4
4
|
*
|
5
|
-
* Permission
|
6
|
-
*
|
7
|
-
*
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
10
|
+
* furnished to do so, subject to the following conditions:
|
8
11
|
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
15
|
-
* OR
|
12
|
+
* The above copyright notice and this permission notice shall be included in
|
13
|
+
* all copies or substantial portions of the Software.
|
14
|
+
*
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
* THE SOFTWARE.
|
16
22
|
*/
|
17
23
|
|
18
24
|
#ifndef BUFFER_H__
|
@@ -80,4 +86,3 @@ void bufprintf(struct buf *, const char *, ...) __attribute__ ((format (printf,
|
|
80
86
|
#endif
|
81
87
|
|
82
88
|
#endif
|
83
|
-
|