wikitext 1.5.2 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. data/ext/ary.c +20 -11
  2. data/ext/ary.h +20 -11
  3. data/ext/extconf.rb +20 -11
  4. data/ext/parser.c +57 -17
  5. data/ext/parser.h +20 -11
  6. data/ext/ruby_compat.h +20 -11
  7. data/ext/str.c +20 -11
  8. data/ext/str.h +20 -11
  9. data/ext/token.c +20 -11
  10. data/ext/token.h +20 -11
  11. data/ext/wikitext.c +20 -11
  12. data/ext/wikitext.h +20 -11
  13. data/ext/wikitext_ragel.h +20 -11
  14. data/lib/wikitext/nil_class.rb +20 -11
  15. data/lib/wikitext/parser.rb +20 -11
  16. data/lib/wikitext/rails.rb +20 -11
  17. data/lib/wikitext/string.rb +20 -11
  18. data/lib/wikitext/version.rb +21 -12
  19. data/rails/init.rb +20 -11
  20. data/spec/autolinking_spec.rb +20 -11
  21. data/spec/base_heading_level_spec.rb +20 -11
  22. data/spec/blockquote_spec.rb +20 -11
  23. data/spec/em_spec.rb +20 -11
  24. data/spec/encoding_spec.rb +20 -11
  25. data/spec/entity_spec.rb +20 -11
  26. data/spec/external_link_spec.rb +20 -11
  27. data/spec/fulltext_spec.rb +20 -11
  28. data/spec/h1_spec.rb +20 -11
  29. data/spec/h2_spec.rb +20 -11
  30. data/spec/h3_spec.rb +20 -11
  31. data/spec/h4_spec.rb +20 -11
  32. data/spec/h5_spec.rb +20 -11
  33. data/spec/h6_spec.rb +20 -11
  34. data/spec/img_spec.rb +20 -11
  35. data/spec/indentation_spec.rb +20 -11
  36. data/spec/integration_spec.rb +20 -11
  37. data/spec/internal_link_spec.rb +20 -11
  38. data/spec/line_endings_spec.rb +20 -11
  39. data/spec/link_encoding_spec.rb +20 -11
  40. data/spec/link_sanitizing_spec.rb +20 -11
  41. data/spec/nil_class_spec.rb +20 -11
  42. data/spec/nowiki_spec.rb +20 -11
  43. data/spec/p_spec.rb +20 -11
  44. data/spec/parser_spec.rb +20 -11
  45. data/spec/pre_spec.rb +20 -11
  46. data/spec/rails_spec.rb +20 -11
  47. data/spec/regressions_spec.rb +42 -11
  48. data/spec/spec_helper.rb +20 -11
  49. data/spec/string_spec.rb +20 -11
  50. data/spec/strong_em_spec.rb +20 -11
  51. data/spec/strong_spec.rb +20 -11
  52. data/spec/tokenizing_spec.rb +20 -11
  53. data/spec/tt_spec.rb +20 -11
  54. data/spec/ul_spec.rb +20 -11
  55. data/spec/version_spec.rb +20 -11
  56. data/spec/wikitext_spec.rb +20 -11
  57. metadata +2 -2
data/ext/ary.c CHANGED
@@ -1,16 +1,25 @@
1
- // Copyright 2008 Wincent Colaiuta
2
- // This program is free software: you can redistribute it and/or modify
3
- // it under the terms of the GNU General Public License as published by
4
- // the Free Software Foundation, either version 3 of the License, or
5
- // (at your option) any later version.
1
+ // Copyright 2008-2009 Wincent Colaiuta. All rights reserved.
6
2
  //
7
- // This program is distributed in the hope that it will be useful,
8
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- // GNU General Public License for more details.
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
11
5
  //
12
- // You should have received a copy of the GNU General Public License
13
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
6
+ // 1. Redistributions of source code must retain the above copyright notice,
7
+ // this list of conditions and the following disclaimer.
8
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
9
+ // this list of conditions and the following disclaimer in the documentation
10
+ // and/or other materials provided with the distribution.
11
+ //
12
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
16
+ // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+ // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
+ // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
+ // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
+ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
+ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+ // POSSIBILITY OF SUCH DAMAGE.
14
23
 
15
24
  #include "ary.h"
16
25
 
data/ext/ary.h CHANGED
@@ -1,16 +1,25 @@
1
- // Copyright 2008 Wincent Colaiuta
2
- // This program is free software: you can redistribute it and/or modify
3
- // it under the terms of the GNU General Public License as published by
4
- // the Free Software Foundation, either version 3 of the License, or
5
- // (at your option) any later version.
1
+ // Copyright 2008-2009 Wincent Colaiuta. All rights reserved.
6
2
  //
7
- // This program is distributed in the hope that it will be useful,
8
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- // GNU General Public License for more details.
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
11
5
  //
12
- // You should have received a copy of the GNU General Public License
13
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
6
+ // 1. Redistributions of source code must retain the above copyright notice,
7
+ // this list of conditions and the following disclaimer.
8
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
9
+ // this list of conditions and the following disclaimer in the documentation
10
+ // and/or other materials provided with the distribution.
11
+ //
12
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
16
+ // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+ // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
+ // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
+ // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
+ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
+ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+ // POSSIBILITY OF SUCH DAMAGE.
14
23
 
15
24
  #include "ruby_compat.h"
16
25
 
data/ext/extconf.rb CHANGED
@@ -1,16 +1,25 @@
1
- # Copyright 2008 Wincent Colaiuta
2
- # This program is free software: you can redistribute it and/or modify
3
- # it under the terms of the GNU General Public License as published by
4
- # the Free Software Foundation, either version 3 of the License, or
5
- # (at your option) any later version.
1
+ # Copyright 2008-2009 Wincent Colaiuta. All rights reserved.
6
2
  #
7
- # This program is distributed in the hope that it will be useful,
8
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- # GNU General Public License for more details.
3
+ # Redistribution and use in source and binary forms, with or without
4
+ # modification, are permitted provided that the following conditions are met:
11
5
  #
12
- # You should have received a copy of the GNU General Public License
13
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
6
+ # 1. Redistributions of source code must retain the above copyright notice,
7
+ # this list of conditions and the following disclaimer.
8
+ # 2. Redistributions in binary form must reproduce the above copyright notice,
9
+ # this list of conditions and the following disclaimer in the documentation
10
+ # and/or other materials provided with the distribution.
11
+
12
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
16
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
+ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+ # POSSIBILITY OF SUCH DAMAGE.
14
23
 
15
24
  require 'mkmf'
16
25
 
data/ext/parser.c CHANGED
@@ -1,16 +1,25 @@
1
- // Copyright 2007-2009 Wincent Colaiuta
2
- // This program is free software: you can redistribute it and/or modify
3
- // it under the terms of the GNU General Public License as published by
4
- // the Free Software Foundation, either version 3 of the License, or
5
- // (at your option) any later version.
1
+ // Copyright 2007-2009 Wincent Colaiuta. All rights reserved.
6
2
  //
7
- // This program is distributed in the hope that it will be useful,
8
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- // GNU General Public License for more details.
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
11
5
  //
12
- // You should have received a copy of the GNU General Public License
13
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
6
+ // 1. Redistributions of source code must retain the above copyright notice,
7
+ // this list of conditions and the following disclaimer.
8
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
9
+ // this list of conditions and the following disclaimer in the documentation
10
+ // and/or other materials provided with the distribution.
11
+ //
12
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
16
+ // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+ // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
+ // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
+ // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
+ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
+ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+ // POSSIBILITY OF SUCH DAMAGE.
14
23
 
15
24
  #include "parser.h"
16
25
  #include "ary.h"
@@ -846,6 +855,22 @@ VALUE Wikitext_parser_encode_special_link_target(VALUE self, VALUE in)
846
855
  return parser.link_target;
847
856
  }
848
857
 
858
+ // returns 1 (true) if supplied string is blank (nil, empty, or all whitespace)
859
+ // returns 0 (false) otherwise
860
+ int _Wikitext_blank(VALUE str)
861
+ {
862
+ if (NIL_P(str) || RSTRING_LEN(str) == 0)
863
+ return 1;
864
+ for (char *ptr = RSTRING_PTR(str),
865
+ *end = RSTRING_PTR(str) + RSTRING_LEN(str);
866
+ ptr < end; ptr++)
867
+ {
868
+ if (*ptr != ' ')
869
+ return 0;
870
+ }
871
+ return 1;
872
+ }
873
+
849
874
  void _Wikitext_rollback_failed_link(parser_t *parser)
850
875
  {
851
876
  if (!IN(LINK_START))
@@ -2124,13 +2149,22 @@ VALUE Wikitext_parser_parse(int argc, VALUE *argv, VALUE self)
2124
2149
  rb_str_cat(parser->link_target, token->start, TOKEN_LEN(token));
2125
2150
  }
2126
2151
  else if (type == LINK_END)
2152
+ {
2153
+ if (NIL_P(parser->link_target)) // bail for inputs like "[[]]"
2154
+ _Wikitext_rollback_failed_link(parser);
2127
2155
  break; // jump back to top of loop (will handle this in LINK_END case below)
2156
+ }
2128
2157
  else if (type == SEPARATOR)
2129
2158
  {
2130
- ary_push(parser->scope, SEPARATOR);
2131
- parser->link_text = rb_str_new2("");
2132
- parser->capture = parser->link_text;
2133
- token = NULL;
2159
+ if (NIL_P(parser->link_target)) // bail for inputs like "[[|"
2160
+ _Wikitext_rollback_failed_link(parser);
2161
+ else
2162
+ {
2163
+ ary_push(parser->scope, SEPARATOR);
2164
+ parser->link_text = rb_str_new2("");
2165
+ parser->capture = parser->link_text;
2166
+ token = NULL;
2167
+ }
2134
2168
  break;
2135
2169
  }
2136
2170
  else // unexpected token (syntax error)
@@ -2155,9 +2189,15 @@ VALUE Wikitext_parser_parse(int argc, VALUE *argv, VALUE self)
2155
2189
  else if (IN(EXT_LINK_START))
2156
2190
  // already in external link scope! (and in fact, must be capturing link_text right now)
2157
2191
  rb_str_cat(i, link_end, sizeof(link_end) - 1);
2158
- else if (IN(LINK_START))
2192
+ else if (IN(LINK_START)) // in internal link scope!
2159
2193
  {
2160
- // in internal link scope!
2194
+ if (_Wikitext_blank(parser->link_target))
2195
+ {
2196
+ // special case for inputs like "[[ ]]"
2197
+ _Wikitext_rollback_failed_link(parser);
2198
+ rb_str_cat(parser->output, link_end, sizeof(link_end) - 1);
2199
+ break;
2200
+ }
2161
2201
  if (NIL_P(parser->link_text) || RSTRING_LEN(parser->link_text) == 0)
2162
2202
  // use link target as link text
2163
2203
  parser->link_text = _Wikitext_parser_sanitize_link_target(parser, Qfalse);
data/ext/parser.h CHANGED
@@ -1,16 +1,25 @@
1
- // Copyright 2008 Wincent Colaiuta
2
- // This program is free software: you can redistribute it and/or modify
3
- // it under the terms of the GNU General Public License as published by
4
- // the Free Software Foundation, either version 3 of the License, or
5
- // (at your option) any later version.
1
+ // Copyright 2008-2009 Wincent Colaiuta. All rights reserved.
6
2
  //
7
- // This program is distributed in the hope that it will be useful,
8
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- // GNU General Public License for more details.
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
11
5
  //
12
- // You should have received a copy of the GNU General Public License
13
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
6
+ // 1. Redistributions of source code must retain the above copyright notice,
7
+ // this list of conditions and the following disclaimer.
8
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
9
+ // this list of conditions and the following disclaimer in the documentation
10
+ // and/or other materials provided with the distribution.
11
+ //
12
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
16
+ // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+ // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
+ // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
+ // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
+ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
+ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+ // POSSIBILITY OF SUCH DAMAGE.
14
23
 
15
24
  #include "ruby_compat.h"
16
25
 
data/ext/ruby_compat.h CHANGED
@@ -1,16 +1,25 @@
1
- // Copyright 2008 Wincent Colaiuta
2
- // This program is free software: you can redistribute it and/or modify
3
- // it under the terms of the GNU General Public License as published by
4
- // the Free Software Foundation, either version 3 of the License, or
5
- // (at your option) any later version.
1
+ // Copyright 2008-2009 Wincent Colaiuta. All rights reserved.
6
2
  //
7
- // This program is distributed in the hope that it will be useful,
8
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- // GNU General Public License for more details.
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
11
5
  //
12
- // You should have received a copy of the GNU General Public License
13
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
6
+ // 1. Redistributions of source code must retain the above copyright notice,
7
+ // this list of conditions and the following disclaimer.
8
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
9
+ // this list of conditions and the following disclaimer in the documentation
10
+ // and/or other materials provided with the distribution.
11
+ //
12
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
16
+ // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+ // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
+ // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
+ // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
+ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
+ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+ // POSSIBILITY OF SUCH DAMAGE.
14
23
 
15
24
  #include <ruby.h>
16
25
 
data/ext/str.c CHANGED
@@ -1,16 +1,25 @@
1
- // Copyright 2008 Wincent Colaiuta
2
- // This program is free software: you can redistribute it and/or modify
3
- // it under the terms of the GNU General Public License as published by
4
- // the Free Software Foundation, either version 3 of the License, or
5
- // (at your option) any later version.
1
+ // Copyright 2008-2009 Wincent Colaiuta. All rights reserved.
6
2
  //
7
- // This program is distributed in the hope that it will be useful,
8
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- // GNU General Public License for more details.
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
11
5
  //
12
- // You should have received a copy of the GNU General Public License
13
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
6
+ // 1. Redistributions of source code must retain the above copyright notice,
7
+ // this list of conditions and the following disclaimer.
8
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
9
+ // this list of conditions and the following disclaimer in the documentation
10
+ // and/or other materials provided with the distribution.
11
+ //
12
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
16
+ // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+ // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
+ // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
+ // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
+ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
+ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+ // POSSIBILITY OF SUCH DAMAGE.
14
23
 
15
24
  #include "str.h"
16
25
 
data/ext/str.h CHANGED
@@ -1,16 +1,25 @@
1
- // Copyright 2008 Wincent Colaiuta
2
- // This program is free software: you can redistribute it and/or modify
3
- // it under the terms of the GNU General Public License as published by
4
- // the Free Software Foundation, either version 3 of the License, or
5
- // (at your option) any later version.
1
+ // Copyright 2008-2009 Wincent Colaiuta. All rights reserved.
6
2
  //
7
- // This program is distributed in the hope that it will be useful,
8
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- // GNU General Public License for more details.
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
11
5
  //
12
- // You should have received a copy of the GNU General Public License
13
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
6
+ // 1. Redistributions of source code must retain the above copyright notice,
7
+ // this list of conditions and the following disclaimer.
8
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
9
+ // this list of conditions and the following disclaimer in the documentation
10
+ // and/or other materials provided with the distribution.
11
+ //
12
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
16
+ // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+ // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
+ // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
+ // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
+ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
+ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+ // POSSIBILITY OF SUCH DAMAGE.
14
23
 
15
24
  #include "ruby_compat.h"
16
25
 
data/ext/token.c CHANGED
@@ -1,16 +1,25 @@
1
- // Copyright 2008-2009 Wincent Colaiuta
2
- // This program is free software: you can redistribute it and/or modify
3
- // it under the terms of the GNU General Public License as published by
4
- // the Free Software Foundation, either version 3 of the License, or
5
- // (at your option) any later version.
1
+ // Copyright 2008-2009 Wincent Colaiuta. All rights reserved.
6
2
  //
7
- // This program is distributed in the hope that it will be useful,
8
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- // GNU General Public License for more details.
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
11
5
  //
12
- // You should have received a copy of the GNU General Public License
13
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
6
+ // 1. Redistributions of source code must retain the above copyright notice,
7
+ // this list of conditions and the following disclaimer.
8
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
9
+ // this list of conditions and the following disclaimer in the documentation
10
+ // and/or other materials provided with the distribution.
11
+ //
12
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
16
+ // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+ // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
+ // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
+ // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
+ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
+ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+ // POSSIBILITY OF SUCH DAMAGE.
14
23
 
15
24
  #include "token.h"
16
25
  #include "wikitext.h"
data/ext/token.h CHANGED
@@ -1,16 +1,25 @@
1
- // Copyright 2008-2009 Wincent Colaiuta
2
- // This program is free software: you can redistribute it and/or modify
3
- // it under the terms of the GNU General Public License as published by
4
- // the Free Software Foundation, either version 3 of the License, or
5
- // (at your option) any later version.
1
+ // Copyright 2008-2009 Wincent Colaiuta. All rights reserved.
6
2
  //
7
- // This program is distributed in the hope that it will be useful,
8
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- // GNU General Public License for more details.
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
11
5
  //
12
- // You should have received a copy of the GNU General Public License
13
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
6
+ // 1. Redistributions of source code must retain the above copyright notice,
7
+ // this list of conditions and the following disclaimer.
8
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
9
+ // this list of conditions and the following disclaimer in the documentation
10
+ // and/or other materials provided with the distribution.
11
+ //
12
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
16
+ // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+ // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
+ // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
+ // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
+ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
+ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+ // POSSIBILITY OF SUCH DAMAGE.
14
23
 
15
24
  #include "ruby_compat.h"
16
25
  #include <stdint.h> /* uint32_t */
data/ext/wikitext.c CHANGED
@@ -1,16 +1,25 @@
1
- // Copyright 2008-2009 Wincent Colaiuta
2
- // This program is free software: you can redistribute it and/or modify
3
- // it under the terms of the GNU General Public License as published by
4
- // the Free Software Foundation, either version 3 of the License, or
5
- // (at your option) any later version.
1
+ // Copyright 2008-2009 Wincent Colaiuta. All rights reserved.
6
2
  //
7
- // This program is distributed in the hope that it will be useful,
8
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- // GNU General Public License for more details.
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
11
5
  //
12
- // You should have received a copy of the GNU General Public License
13
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
6
+ // 1. Redistributions of source code must retain the above copyright notice,
7
+ // this list of conditions and the following disclaimer.
8
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
9
+ // this list of conditions and the following disclaimer in the documentation
10
+ // and/or other materials provided with the distribution.
11
+ //
12
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
16
+ // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+ // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
+ // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
+ // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
+ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
+ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+ // POSSIBILITY OF SUCH DAMAGE.
14
23
 
15
24
  #include "wikitext_ragel.h"
16
25
  #include "parser.h"
data/ext/wikitext.h CHANGED
@@ -1,16 +1,25 @@
1
- // Copyright 2008 Wincent Colaiuta
2
- // This program is free software: you can redistribute it and/or modify
3
- // it under the terms of the GNU General Public License as published by
4
- // the Free Software Foundation, either version 3 of the License, or
5
- // (at your option) any later version.
1
+ // Copyright 2008-2009 Wincent Colaiuta. All rights reserved.
6
2
  //
7
- // This program is distributed in the hope that it will be useful,
8
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- // GNU General Public License for more details.
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
11
5
  //
12
- // You should have received a copy of the GNU General Public License
13
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
6
+ // 1. Redistributions of source code must retain the above copyright notice,
7
+ // this list of conditions and the following disclaimer.
8
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
9
+ // this list of conditions and the following disclaimer in the documentation
10
+ // and/or other materials provided with the distribution.
11
+ //
12
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
16
+ // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+ // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
+ // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
+ // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
+ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
+ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+ // POSSIBILITY OF SUCH DAMAGE.
14
23
 
15
24
  #include "ruby_compat.h"
16
25
  #include <stdint.h>
data/ext/wikitext_ragel.h CHANGED
@@ -1,16 +1,25 @@
1
- // Copyright 2008 Wincent Colaiuta
2
- // This program is free software: you can redistribute it and/or modify
3
- // it under the terms of the GNU General Public License as published by
4
- // the Free Software Foundation, either version 3 of the License, or
5
- // (at your option) any later version.
1
+ // Copyright 2008-2009 Wincent Colaiuta. All rights reserved.
6
2
  //
7
- // This program is distributed in the hope that it will be useful,
8
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- // GNU General Public License for more details.
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
11
5
  //
12
- // You should have received a copy of the GNU General Public License
13
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
6
+ // 1. Redistributions of source code must retain the above copyright notice,
7
+ // this list of conditions and the following disclaimer.
8
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
9
+ // this list of conditions and the following disclaimer in the documentation
10
+ // and/or other materials provided with the distribution.
11
+ //
12
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
16
+ // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+ // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
+ // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
+ // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
+ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
+ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+ // POSSIBILITY OF SUCH DAMAGE.
14
23
 
15
24
  #include "token.h"
16
25
 
@@ -1,16 +1,25 @@
1
- # Copyright 2008 Wincent Colaiuta
2
- # This program is free software: you can redistribute it and/or modify
3
- # it under the terms of the GNU General Public License as published by
4
- # the Free Software Foundation, either version 3 of the License, or
5
- # (at your option) any later version.
1
+ # Copyright 2008-2009 Wincent Colaiuta. All rights reserved.
6
2
  #
7
- # This program is distributed in the hope that it will be useful,
8
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- # GNU General Public License for more details.
3
+ # Redistribution and use in source and binary forms, with or without
4
+ # modification, are permitted provided that the following conditions are met:
11
5
  #
12
- # You should have received a copy of the GNU General Public License
13
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
6
+ # 1. Redistributions of source code must retain the above copyright notice,
7
+ # this list of conditions and the following disclaimer.
8
+ # 2. Redistributions in binary form must reproduce the above copyright notice,
9
+ # this list of conditions and the following disclaimer in the documentation
10
+ # and/or other materials provided with the distribution.
11
+
12
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
16
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
+ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+ # POSSIBILITY OF SUCH DAMAGE.
14
23
 
15
24
  require 'wikitext'
16
25