redcarpet 3.3.2 → 3.3.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of redcarpet might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4549cbe772995b6ab432142d20b4e4de5c45229c
4
- data.tar.gz: b80438cae22fe723e749a432fcaaa7656f7f660b
3
+ metadata.gz: 0bf67bb848da96547839cc6c602061b2671320a8
4
+ data.tar.gz: 696770a2783fb0650f20187b0e6c40cc6eedf4d9
5
5
  SHA512:
6
- metadata.gz: 0a04dd8f57fdeb53ecb79c28e680915c607d6e4b95b7888b7b3bc86ea1729d9b1aeccf710b00d1849989ce940aaccdc126e796d17acbbdd3ca3e8b924e756673
7
- data.tar.gz: fe26df7e15e06d3a34e5a253000d5cfc8c0c77e2b5cd56ad04f0484af90349bfbb84e1b5d80df3ac189a3509c1b46d8f56e9f8d4033b00350410775856f6d63a
6
+ metadata.gz: bdfb5d5ae166559eba36b7b7e057556ca3d3b18565c8c711753594c8ac584a64bee9f4d11bb89cd92d40b1e5e0d4953f35ab3788a0e2469b3201a8f1d07d4f05
7
+ data.tar.gz: 8ef5048a94f1971b574dd041676187b14aafd46552c437e5e752779dee3d6b147d93e02795f4c0c3cf9a91bf215e6ec04f66ef0ab75cbc7f8fc7dc6316c7f117
data/COPYING CHANGED
@@ -1,14 +1,20 @@
1
1
  Copyright (c) 2009, Natacha Porté
2
- Copyright (c) 2011, Vicent Marti
2
+ Copyright (c) 2015, Vicent Marti
3
3
 
4
- Permission to use, copy, modify, and distribute this software for any
5
- purpose with or without fee is hereby granted, provided that the above
6
- copyright notice and this permission notice appear in all copies.
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
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
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
@@ -3,7 +3,7 @@ source "https://rubygems.org/"
3
3
  gemspec
4
4
 
5
5
  group :benchmark do
6
- gem "benchmark-ips", "~> 1.2.0"
6
+ gem "benchmark-ips", "~> 2.3.0"
7
7
  gem "bluecloth", "~> 2.2.0"
8
- gem "kramdown", "~> 1.0.2"
8
+ gem "kramdown", "~> 1.8.0"
9
9
  end
@@ -83,7 +83,7 @@ but starting with `www` are also handled.
83
83
 
84
84
  * `:disable_indented_code_blocks`: do not parse usual markdown
85
85
  code blocks. Markdown converts text with four spaces at
86
- the front of each line to code blocks. This options
86
+ the front of each line to code blocks. This option
87
87
  prevents it from doing so. Recommended to use
88
88
  with `fenced_code_blocks: true`.
89
89
 
@@ -159,7 +159,7 @@ safe.
159
159
  * `:with_toc_data`: add HTML anchors to each header in the output HTML,
160
160
  to allow linking to each section.
161
161
 
162
- * `:hard_wrap`: insert HTML `<br>` tags inside on paragraphs where the origin
162
+ * `:hard_wrap`: insert HTML `<br>` tags inside paragraphs where the original
163
163
  Markdown document had newlines (by default, Markdown ignores these newlines).
164
164
 
165
165
  * `:xhtml`: output XHTML-conformant tags. This option is always enabled in the
@@ -372,16 +372,22 @@ monkeypatches the Markdown class, you're a terrible human being. Just saying.
372
372
  Boring legal stuff
373
373
  ------------------
374
374
 
375
- Copyright (c) 2011-2014, Vicent Martí
376
-
377
- Permission to use, copy, modify, and/or distribute this software for any
378
- purpose with or without fee is hereby granted, provided that the above
379
- copyright notice and this permission notice appear in all copies.
380
-
381
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
382
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
383
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
384
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
385
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
386
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
387
- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
375
+ Copyright (c) 2011-2015, Vicent Martí
376
+
377
+ Permission is hereby granted, free of charge, to any person obtaining a copy
378
+ of this software and associated documentation files (the "Software"), to deal
379
+ in the Software without restriction, including without limitation the rights
380
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
381
+ copies of the Software, and to permit persons to whom the Software is
382
+ furnished to do so, subject to the following conditions:
383
+
384
+ The above copyright notice and this permission notice shall be included in
385
+ all copies or substantial portions of the Software.
386
+
387
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
388
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
389
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
390
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
391
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
392
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
393
+ THE SOFTWARE.
@@ -1,17 +1,23 @@
1
1
  /*
2
- * Copyright (c) 2011, Vicent Marti
2
+ * Copyright (c) 2015, Vicent Marti
3
3
  *
4
- * Permission to use, copy, modify, and distribute this software for any
5
- * purpose with or without fee is hereby granted, provided that the above
6
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
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"
@@ -1,17 +1,23 @@
1
1
  /*
2
- * Copyright (c) 2011, Vicent Marti
2
+ * Copyright (c) 2015, Vicent Marti
3
3
  *
4
- * Permission to use, copy, modify, and distribute this software for any
5
- * purpose with or without fee is hereby granted, provided that the above
6
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
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__
@@ -1,18 +1,24 @@
1
1
  /*
2
2
  * Copyright (c) 2008, Natacha Porté
3
- * Copyright (c) 2011, Vicent Martí
3
+ * Copyright (c) 2015, Vicent Marti
4
4
  *
5
- * Permission to use, copy, modify, and distribute this software for any
6
- * purpose with or without fee is hereby granted, provided that the above
7
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
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
@@ -1,18 +1,24 @@
1
1
  /*
2
2
  * Copyright (c) 2008, Natacha Porté
3
- * Copyright (c) 2011, Vicent Martí
3
+ * Copyright (c) 2015, Vicent Marti
4
4
  *
5
- * Permission to use, copy, modify, and distribute this software for any
6
- * purpose with or without fee is hereby granted, provided that the above
7
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
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__
@@ -1,3 +1,25 @@
1
+ /*
2
+ * Copyright (c) 2015, Vicent Marti
3
+ *
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:
10
+ *
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.
21
+ */
22
+
1
23
  #ifndef HOUDINI_H__
2
24
  #define HOUDINI_H__
3
25
 
@@ -1,3 +1,25 @@
1
+ /*
2
+ * Copyright (c) 2015, Vicent Marti
3
+ *
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:
10
+ *
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.
21
+ */
22
+
1
23
  #include <assert.h>
2
24
  #include <stdio.h>
3
25
  #include <string.h>
@@ -1,3 +1,25 @@
1
+ /*
2
+ * Copyright (c) 2015, Vicent Marti
3
+ *
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:
10
+ *
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.
21
+ */
22
+
1
23
  #include <assert.h>
2
24
  #include <stdio.h>
3
25
  #include <string.h>
@@ -1,18 +1,24 @@
1
1
  /*
2
2
  * Copyright (c) 2009, Natacha Porté
3
- * Copyright (c) 2011, Vicent Marti
3
+ * Copyright (c) 2015, Vicent Marti
4
4
  *
5
- * Permission to use, copy, modify, and distribute this software for any
6
- * purpose with or without fee is hereby granted, provided that the above
7
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
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
  #include "markdown.h"
@@ -1,17 +1,23 @@
1
1
  /*
2
- * Copyright (c) 2011, Vicent Marti
2
+ * Copyright (c) 2015, Vicent Marti
3
3
  *
4
- * Permission to use, copy, modify, and distribute this software for any
5
- * purpose with or without fee is hereby granted, provided that the above
6
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
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 HTML_H__
@@ -1,17 +1,23 @@
1
1
  /*
2
- * Copyright (c) 2011, Vicent Marti
2
+ * Copyright (c) 2015, Vicent Marti
3
3
  *
4
- * Permission to use, copy, modify, and distribute this software for any
5
- * purpose with or without fee is hereby granted, provided that the above
6
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
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"
@@ -83,6 +89,12 @@ word_boundary(uint8_t c)
83
89
  return c == 0 || isspace(c) || ispunct(c);
84
90
  }
85
91
 
92
+ static inline int
93
+ fraction_boundary(uint8_t c)
94
+ {
95
+ return c == 0 || isspace(c) || (c != '/' && ispunct(c));
96
+ }
97
+
86
98
  // If 'text' begins with any kind of single quote (e.g. "'" or "&apos;" etc.),
87
99
  // returns the length of the sequence of characters that makes up the single-
88
100
  // quote. Otherwise, returns zero.
@@ -282,16 +294,16 @@ smartypants_cb__backtick(struct buf *ob, struct smartypants_data *smrt, uint8_t
282
294
  static size_t
283
295
  smartypants_cb__number(struct buf *ob, struct smartypants_data *smrt, uint8_t previous_char, const uint8_t *text, size_t size)
284
296
  {
285
- if (word_boundary(previous_char) && size >= 3) {
297
+ if (fraction_boundary(previous_char) && size >= 3) {
286
298
  if (text[0] == '1' && text[1] == '/' && text[2] == '2') {
287
- if (size == 3 || word_boundary(text[3])) {
299
+ if (size == 3 || fraction_boundary(text[3])) {
288
300
  BUFPUTSL(ob, "&frac12;");
289
301
  return 2;
290
302
  }
291
303
  }
292
304
 
293
305
  if (text[0] == '1' && text[1] == '/' && text[2] == '4') {
294
- if (size == 3 || word_boundary(text[3]) ||
306
+ if (size == 3 || fraction_boundary(text[3]) ||
295
307
  (size >= 5 && tolower(text[3]) == 't' && tolower(text[4]) == 'h')) {
296
308
  BUFPUTSL(ob, "&frac14;");
297
309
  return 2;
@@ -299,7 +311,7 @@ smartypants_cb__number(struct buf *ob, struct smartypants_data *smrt, uint8_t pr
299
311
  }
300
312
 
301
313
  if (text[0] == '3' && text[1] == '/' && text[2] == '4') {
302
- if (size == 3 || word_boundary(text[3]) ||
314
+ if (size == 3 || fraction_boundary(text[3]) ||
303
315
  (size >= 6 && tolower(text[3]) == 't' && tolower(text[4]) == 'h' && tolower(text[5]) == 's')) {
304
316
  BUFPUTSL(ob, "&frac34;");
305
317
  return 2;
@@ -1,20 +1,24 @@
1
- /* markdown.c - generic markdown parser */
2
-
3
1
  /*
4
2
  * Copyright (c) 2009, Natacha Porté
5
- * Copyright (c) 2011, Vicent Marti
3
+ * Copyright (c) 2015, Vicent Marti
4
+ *
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:
6
11
  *
7
- * Permission to use, copy, modify, and distribute this software for any
8
- * purpose with or without fee is hereby granted, provided that the above
9
- * copyright notice and this permission notice appear in all copies.
12
+ * The above copyright notice and this permission notice shall be included in
13
+ * all copies or substantial portions of the Software.
10
14
  *
11
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
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.
18
22
  */
19
23
 
20
24
  #include "markdown.h"
@@ -1,19 +1,24 @@
1
- /* markdown.h - generic markdown parser */
2
-
3
1
  /*
4
2
  * Copyright (c) 2009, Natacha Porté
3
+ * Copyright (c) 2015, Vicent Marti
4
+ *
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:
5
11
  *
6
- * Permission to use, copy, modify, and distribute this software for any
7
- * purpose with or without fee is hereby granted, provided that the above
8
- * copyright notice and this permission notice appear in all copies.
12
+ * The above copyright notice and this permission notice shall be included in
13
+ * all copies or substantial portions of the Software.
9
14
  *
10
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
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.
17
22
  */
18
23
 
19
24
  #ifndef MARKDOWN_H__
@@ -1,18 +1,25 @@
1
1
  /*
2
- * Copyright (c) 2011, Vicent Marti
2
+ * Copyright (c) 2015, Vicent Marti
3
3
  *
4
- * Permission to use, copy, modify, and distribute this software for any
5
- * purpose with or without fee is hereby granted, provided that the above
6
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
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
  */
22
+
16
23
  #include "redcarpet.h"
17
24
 
18
25
  VALUE rb_mRedcarpet;
@@ -1,17 +1,23 @@
1
1
  /*
2
- * Copyright (c) 2011, Vicent Marti
2
+ * Copyright (c) 2015, Vicent Marti
3
3
  *
4
- * Permission to use, copy, modify, and distribute this software for any
5
- * purpose with or without fee is hereby granted, provided that the above
6
- * copyright notice and this permission notice appear in all copies.
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
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
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 "redcarpet.h"
@@ -369,11 +375,16 @@ static void rb_redcarpet_rbase_mark(struct rb_redcarpet_rndr *rndr)
369
375
  rb_gc_mark(rndr->options.link_attributes);
370
376
  }
371
377
 
378
+ static void rndr_deallocate(void *rndr)
379
+ {
380
+ xfree(rndr);
381
+ }
382
+
372
383
  static VALUE rb_redcarpet_rbase_alloc(VALUE klass)
373
384
  {
374
385
  struct rb_redcarpet_rndr *rndr = ALLOC(struct rb_redcarpet_rndr);
375
386
  memset(rndr, 0x0, sizeof(struct rb_redcarpet_rndr));
376
- return Data_Wrap_Struct(klass, rb_redcarpet_rbase_mark, NULL, rndr);
387
+ return Data_Wrap_Struct(klass, rb_redcarpet_rbase_mark, rndr_deallocate, rndr);
377
388
  }
378
389
 
379
390
  static void rb_redcarpet__overload(VALUE self, VALUE base_class)
@@ -1,3 +1,25 @@
1
+ /*
2
+ * Copyright (c) 2015, Vicent Marti
3
+ *
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:
10
+ *
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.
21
+ */
22
+
1
23
  #ifndef REDCARPET_H__
2
24
  #define REDCARPET_H__
3
25
 
@@ -1,3 +1,25 @@
1
+ /*
2
+ * Copyright (c) 2015, Vicent Marti
3
+ *
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:
10
+ *
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.
21
+ */
22
+
1
23
  #include "stack.h"
2
24
  #include <string.h>
3
25
 
@@ -1,3 +1,25 @@
1
+ /*
2
+ * Copyright (c) 2015, Vicent Marti
3
+ *
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:
10
+ *
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.
21
+ */
22
+
1
23
  #ifndef STACK_H__
2
24
  #define STACK_H__
3
25
 
@@ -2,7 +2,7 @@ require 'redcarpet.so'
2
2
  require 'redcarpet/compat'
3
3
 
4
4
  module Redcarpet
5
- VERSION = '3.3.2'
5
+ VERSION = '3.3.3'
6
6
 
7
7
  class Markdown
8
8
  attr_reader :renderer
@@ -13,7 +13,7 @@ module Redcarpet
13
13
  :autolink, :codespan, :double_emphasis,
14
14
  :emphasis, :underline, :raw_html,
15
15
  :triple_emphasis, :strikethrough,
16
- :superscript,
16
+ :superscript, :highlight,
17
17
 
18
18
  # footnotes
19
19
  :footnotes, :footnote_def, :footnote_ref,
@@ -43,6 +43,18 @@ module Redcarpet
43
43
  def header(text, header_level)
44
44
  text + "\n"
45
45
  end
46
+
47
+ def table(header, body)
48
+ "#{header}#{body}"
49
+ end
50
+
51
+ def table_row(content)
52
+ content + "\n"
53
+ end
54
+
55
+ def table_cell(content, alignment)
56
+ content + "\t"
57
+ end
46
58
  end
47
59
  end
48
60
  end
@@ -1,10 +1,10 @@
1
1
  # encoding: utf-8
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'redcarpet'
4
- s.version = '3.3.2'
4
+ s.version = '3.3.3'
5
5
  s.summary = "Markdown that smells nice"
6
6
  s.description = 'A fast, safe and extensible Markdown to (X)HTML parser'
7
- s.date = '2015-06-22'
7
+ s.date = '2015-09-24'
8
8
  s.email = 'vicent@github.com'
9
9
  s.homepage = 'http://github.com/vmg/redcarpet'
10
10
  s.authors = ["Natacha Porté", "Vicent Martí"]
@@ -65,6 +65,6 @@ Gem::Specification.new do |s|
65
65
  s.executables = ["redcarpet"]
66
66
  s.require_paths = ["lib"]
67
67
 
68
- s.add_development_dependency "rake-compiler", "~> 0.8.3"
69
- s.add_development_dependency "test-unit", "~> 3.0.9"
68
+ s.add_development_dependency "rake-compiler", "~> 0.9.5"
69
+ s.add_development_dependency "test-unit", "~> 3.1.3"
70
70
  end
@@ -264,6 +264,18 @@ fenced
264
264
  assert out.include?("[1]: http://google.com")
265
265
  end
266
266
 
267
+ def test_that_fenced_code_copies_language_verbatim_with_braces
268
+ text = "```{rust,no_run}\nx = 'foo'\n```"
269
+ html = render_with({:fenced_code_blocks => true}, text)
270
+ assert_equal "<pre><code class=\"rust,no_run\">x = &#39;foo&#39;\n</code></pre>\n", html
271
+ end
272
+
273
+ def test_that_fenced_code_copies_language_verbatim
274
+ text = "```rust,no_run\nx = 'foo'\n```"
275
+ html = render_with({:fenced_code_blocks => true}, text)
276
+ assert_equal "<pre><code class=\"rust,no_run\">x = &#39;foo&#39;\n</code></pre>\n", html
277
+ end
278
+
267
279
  def test_that_indented_flag_works
268
280
  text = <<indented
269
281
  This is a simple text
@@ -2,34 +2,33 @@ require 'test_helper'
2
2
 
3
3
  class SafeRenderTest < Redcarpet::TestCase
4
4
  def setup
5
- @render = Redcarpet::Render::Safe
6
- @parser = Redcarpet::Markdown.new(@render, fenced_code_blocks: true)
5
+ @renderer = Redcarpet::Render::Safe
7
6
  end
8
7
 
9
8
  def test_safe_links_only_is_enabled_by_default
10
9
  markdown = "[foo](javascript:alert('foo'))"
11
- output = @parser.render(markdown)
10
+ output = render(markdown)
12
11
 
13
12
  assert_not_match %r{a href}, output
14
13
  end
15
14
 
16
15
  def test_escape_html_is_enabled_by_default
17
16
  markdown = "<p>Hello world!</p>"
18
- output = @parser.render(markdown)
17
+ output = render(markdown)
19
18
 
20
19
  assert_match %r{&lt;}, output
21
20
  end
22
21
 
23
22
  def test_html_escaping_in_code_blocks
24
23
  markdown = "~~~\n<p>Hello!</p>\n~~~"
25
- output = @parser.render(markdown)
24
+ output = render(markdown)
26
25
 
27
26
  assert_match %r{&lt;p&gt;}, output
28
27
  end
29
28
 
30
29
  def test_lang_class_is_removed
31
30
  markdown = "~~~ruby\nclass Foo; end\n~~~"
32
- output = @parser.render(markdown)
31
+ output = render(markdown, with: [:fenced_code_blocks])
33
32
 
34
33
  assert_not_match %r{ruby}, output
35
34
  end
@@ -3,42 +3,42 @@ require 'test_helper'
3
3
 
4
4
  class SmartyHTMLTest < Redcarpet::TestCase
5
5
  def setup
6
- @smarty_markdown = Redcarpet::Markdown.new(Redcarpet::Render::SmartyHTML)
6
+ @renderer = Redcarpet::Render::SmartyHTML
7
7
  end
8
8
 
9
9
  def test_that_smartyhtml_converts_single_quotes
10
- markdown = @smarty_markdown.render("They're not for sale.")
10
+ markdown = render("They're not for sale.")
11
11
  assert_equal "<p>They&rsquo;re not for sale.</p>\n", markdown
12
12
  end
13
13
 
14
14
  def test_that_smartyhtml_converts_double_quotes
15
- rd = @smarty_markdown.render(%("Quoted text"))
15
+ rd = render(%("Quoted text"))
16
16
  assert_equal %(<p>&ldquo;Quoted text&rdquo;</p>\n), rd
17
17
  end
18
18
 
19
19
  def test_that_smartyhtml_converts_double_hyphen
20
- rd = @smarty_markdown.render("double hyphen -- ndash")
20
+ rd = render("double hyphen -- ndash")
21
21
  assert_equal "<p>double hyphen &ndash; ndash</p>\n", rd
22
22
  end
23
23
 
24
24
  def test_that_smartyhtml_converts_triple_hyphen
25
- rd = @smarty_markdown.render("triple hyphen --- mdash")
25
+ rd = render("triple hyphen --- mdash")
26
26
  assert_equal "<p>triple hyphen &mdash; mdash</p>\n", rd
27
27
  end
28
28
 
29
29
  def test_that_smartyhtml_ignores_double_hyphen_in_code
30
- rd = @smarty_markdown.render("double hyphen in `--option`")
30
+ rd = render("double hyphen in `--option`")
31
31
  assert_equal "<p>double hyphen in <code>--option</code></p>\n", rd
32
32
  end
33
33
 
34
34
  def test_that_smartyhtml_ignores_pre
35
- rd = @smarty_markdown.render(" It's a test of \"pre\"\n")
35
+ rd = render(" It's a test of \"pre\"\n")
36
36
  expected = "It&#39;s a test of &quot;pre&quot;"
37
37
  assert rd.include?(expected), "\"#{rd}\" should contain \"#{expected}\""
38
38
  end
39
39
 
40
40
  def test_that_smartyhtml_ignores_code
41
- rd = @smarty_markdown.render("`It's a test of \"code\"`\n")
41
+ rd = render("`It's a test of \"code\"`\n")
42
42
  expected = "It&#39;s a test of &quot;code&quot;"
43
43
  assert rd.include?(expected), "\"#{rd}\" should contain \"#{expected}\""
44
44
  end
@@ -45,4 +45,9 @@ class SmartyPantsTest < Redcarpet::TestCase
45
45
  rd = @pants.render("<p>Hopin' that this bug gets some fixin'.</p>")
46
46
  assert_equal "<p>Hopin&rsquo; that this bug gets some fixin&rsquo;.</p>", rd
47
47
  end
48
+
49
+ def test_that_is_not_confused_by_fractions
50
+ rd = @pants.render('I am 1/4... of the way to 1/4/2000')
51
+ assert_equal "I am &frac14;&hellip; of the way to 1/4/2000", rd
52
+ end
48
53
  end
@@ -3,19 +3,19 @@ require 'test_helper'
3
3
 
4
4
  class StripDownRender < Redcarpet::TestCase
5
5
  def setup
6
- @parser = Redcarpet::Markdown.new(Redcarpet::Render::StripDown)
6
+ @renderer = Redcarpet::Render::StripDown
7
7
  end
8
8
 
9
9
  def test_titles
10
10
  markdown = "# Foo bar"
11
- output = @parser.render(markdown)
11
+ output = render(markdown)
12
12
 
13
13
  assert_equal "Foo bar\n", output
14
14
  end
15
15
 
16
16
  def test_code_blocks
17
17
  markdown = "\tclass Foo\n\tend"
18
- output = @parser.render(markdown)
18
+ output = render(markdown)
19
19
 
20
20
  assert_equal "class Foo\nend\n", output
21
21
  end
@@ -25,7 +25,7 @@ class StripDownRender < Redcarpet::TestCase
25
25
  "And this: ![](http://example.org/image.jpg)"
26
26
  expected = "Look at this picture http://example.org/picture.png\n" \
27
27
  "And this: http://example.org/image.jpg\n"
28
- output = @parser.render(markdown)
28
+ output = render(markdown)
29
29
 
30
30
  assert_equal expected, output
31
31
  end
@@ -33,7 +33,28 @@ class StripDownRender < Redcarpet::TestCase
33
33
  def test_links
34
34
  markdown = "Here's an [example](https://github.com)"
35
35
  expected = "Here's an example (https://github.com)\n"
36
- output = @parser.render(markdown)
36
+ output = render(markdown)
37
+
38
+ assert_equal expected, output
39
+ end
40
+
41
+ def test_tables
42
+ markdown = "| Left-Aligned | Centre Aligned | Right Aligned |\n" \
43
+ "| :------------ |:---------------:| -----:|\n" \
44
+ "| col 3 is | some wordy text | $1600 |\n" \
45
+ "| col 2 is | centered | $12 |"
46
+ expected = "Left-Aligned\tCentre Aligned\tRight Aligned\t\n" \
47
+ "col 3 is\tsome wordy text\t$1600\t\n" \
48
+ "col 2 is\tcentered\t$12\t\n"
49
+ output = render(markdown, with: [:tables])
50
+
51
+ assert_equal expected, output
52
+ end
53
+
54
+ def test_highlight
55
+ markdown = "==Hello world!=="
56
+ expected = "Hello world!\n"
57
+ output = render(markdown, with: [:highlight])
37
58
 
38
59
  assert_equal expected, output
39
60
  end
@@ -1,5 +1,6 @@
1
1
  # coding: UTF-8
2
- Encoding.default_internal = 'UTF-8' if defined? Encoding
2
+ $:.unshift(File.expand_path('../../lib', __FILE__))
3
+ Encoding.default_internal = 'UTF-8'
3
4
 
4
5
  require 'test/unit'
5
6
 
@@ -19,7 +20,12 @@ class Redcarpet::TestCase < Test::Unit::TestCase
19
20
  options = Hash[options.map {|o| [o, true]}]
20
21
  end
21
22
 
22
- render = renderer.new(options)
23
+ render = begin
24
+ renderer.new(options)
25
+ rescue ArgumentError
26
+ renderer.new
27
+ end
28
+
23
29
  parser = Redcarpet::Markdown.new(render, options)
24
30
 
25
31
  parser.render(markdown)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redcarpet
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.2
4
+ version: 3.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Natacha Porté
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-06-22 00:00:00.000000000 Z
12
+ date: 2015-09-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler
@@ -17,28 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 0.8.3
20
+ version: 0.9.5
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 0.8.3
27
+ version: 0.9.5
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: test-unit
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 3.0.9
34
+ version: 3.1.3
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 3.0.9
41
+ version: 3.1.3
42
42
  description: A fast, safe and extensible Markdown to (X)HTML parser
43
43
  email: vicent@github.com
44
44
  executables:
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  version: '0'
114
114
  requirements: []
115
115
  rubyforge_project:
116
- rubygems_version: 2.2.2
116
+ rubygems_version: 2.2.5
117
117
  signing_key:
118
118
  specification_version: 4
119
119
  summary: Markdown that smells nice