commonmarker 0.23.10 → 2.1.1
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.
- checksums.yaml +4 -4
 - data/Cargo.lock +1156 -0
 - data/Cargo.toml +7 -0
 - data/README.md +237 -172
 - data/ext/commonmarker/Cargo.toml +20 -0
 - data/ext/commonmarker/extconf.rb +3 -6
 - data/ext/commonmarker/src/lib.rs +103 -0
 - data/ext/commonmarker/src/node.rs +1221 -0
 - data/ext/commonmarker/src/options.rs +220 -0
 - data/ext/commonmarker/src/plugins/syntax_highlighting.rs +166 -0
 - data/ext/commonmarker/src/plugins.rs +6 -0
 - data/ext/commonmarker/src/utils.rs +8 -0
 - data/lib/commonmarker/config.rb +92 -40
 - data/lib/commonmarker/constants.rb +7 -0
 - data/lib/commonmarker/extension.rb +14 -0
 - data/lib/commonmarker/node/ast.rb +8 -0
 - data/lib/commonmarker/node/inspect.rb +14 -4
 - data/lib/commonmarker/node.rb +29 -47
 - data/lib/commonmarker/renderer.rb +1 -127
 - data/lib/commonmarker/utils.rb +22 -0
 - data/lib/commonmarker/version.rb +2 -2
 - data/lib/commonmarker.rb +27 -25
 - metadata +38 -191
 - data/Rakefile +0 -109
 - data/bin/commonmarker +0 -118
 - data/commonmarker.gemspec +0 -38
 - data/ext/commonmarker/arena.c +0 -104
 - data/ext/commonmarker/autolink.c +0 -508
 - data/ext/commonmarker/autolink.h +0 -8
 - data/ext/commonmarker/blocks.c +0 -1622
 - data/ext/commonmarker/buffer.c +0 -278
 - data/ext/commonmarker/buffer.h +0 -116
 - data/ext/commonmarker/case_fold_switch.inc +0 -4327
 - data/ext/commonmarker/chunk.h +0 -135
 - data/ext/commonmarker/cmark-gfm-core-extensions.h +0 -54
 - data/ext/commonmarker/cmark-gfm-extension_api.h +0 -737
 - data/ext/commonmarker/cmark-gfm-extensions_export.h +0 -42
 - data/ext/commonmarker/cmark-gfm.h +0 -833
 - data/ext/commonmarker/cmark-gfm_export.h +0 -42
 - data/ext/commonmarker/cmark-gfm_version.h +0 -7
 - data/ext/commonmarker/cmark.c +0 -55
 - data/ext/commonmarker/cmark_ctype.c +0 -44
 - data/ext/commonmarker/cmark_ctype.h +0 -33
 - data/ext/commonmarker/commonmark.c +0 -514
 - data/ext/commonmarker/commonmarker.c +0 -1308
 - data/ext/commonmarker/commonmarker.h +0 -16
 - data/ext/commonmarker/config.h +0 -76
 - data/ext/commonmarker/core-extensions.c +0 -27
 - data/ext/commonmarker/entities.inc +0 -2138
 - data/ext/commonmarker/ext_scanners.c +0 -879
 - data/ext/commonmarker/ext_scanners.h +0 -24
 - data/ext/commonmarker/footnotes.c +0 -63
 - data/ext/commonmarker/footnotes.h +0 -27
 - data/ext/commonmarker/houdini.h +0 -57
 - data/ext/commonmarker/houdini_href_e.c +0 -100
 - data/ext/commonmarker/houdini_html_e.c +0 -66
 - data/ext/commonmarker/houdini_html_u.c +0 -149
 - data/ext/commonmarker/html.c +0 -502
 - data/ext/commonmarker/html.h +0 -27
 - data/ext/commonmarker/inlines.c +0 -1788
 - data/ext/commonmarker/inlines.h +0 -29
 - data/ext/commonmarker/iterator.c +0 -159
 - data/ext/commonmarker/iterator.h +0 -26
 - data/ext/commonmarker/latex.c +0 -468
 - data/ext/commonmarker/linked_list.c +0 -37
 - data/ext/commonmarker/man.c +0 -274
 - data/ext/commonmarker/map.c +0 -129
 - data/ext/commonmarker/map.h +0 -44
 - data/ext/commonmarker/node.c +0 -1045
 - data/ext/commonmarker/node.h +0 -167
 - data/ext/commonmarker/parser.h +0 -59
 - data/ext/commonmarker/plaintext.c +0 -218
 - data/ext/commonmarker/plugin.c +0 -36
 - data/ext/commonmarker/plugin.h +0 -34
 - data/ext/commonmarker/references.c +0 -43
 - data/ext/commonmarker/references.h +0 -26
 - data/ext/commonmarker/registry.c +0 -63
 - data/ext/commonmarker/registry.h +0 -24
 - data/ext/commonmarker/render.c +0 -213
 - data/ext/commonmarker/render.h +0 -62
 - data/ext/commonmarker/scanners.c +0 -14056
 - data/ext/commonmarker/scanners.h +0 -70
 - data/ext/commonmarker/scanners.re +0 -341
 - data/ext/commonmarker/strikethrough.c +0 -167
 - data/ext/commonmarker/strikethrough.h +0 -9
 - data/ext/commonmarker/syntax_extension.c +0 -149
 - data/ext/commonmarker/syntax_extension.h +0 -34
 - data/ext/commonmarker/table.c +0 -917
 - data/ext/commonmarker/table.h +0 -12
 - data/ext/commonmarker/tagfilter.c +0 -60
 - data/ext/commonmarker/tagfilter.h +0 -8
 - data/ext/commonmarker/tasklist.c +0 -156
 - data/ext/commonmarker/tasklist.h +0 -8
 - data/ext/commonmarker/utf8.c +0 -317
 - data/ext/commonmarker/utf8.h +0 -35
 - data/ext/commonmarker/xml.c +0 -182
 - data/lib/commonmarker/renderer/html_renderer.rb +0 -256
 
| 
         @@ -1,16 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            #ifndef COMMONMARKER_H
         
     | 
| 
       2 
     | 
    
         
            -
            #define COMMONMARKER_H
         
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
            #ifndef __MSXML_LIBRARY_DEFINED__
         
     | 
| 
       5 
     | 
    
         
            -
            #define __MSXML_LIBRARY_DEFINED__
         
     | 
| 
       6 
     | 
    
         
            -
            #endif
         
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
            #include "cmark-gfm.h"
         
     | 
| 
       9 
     | 
    
         
            -
            #include "ruby.h"
         
     | 
| 
       10 
     | 
    
         
            -
            #include "ruby/encoding.h"
         
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
            #define CSTR2SYM(s) (ID2SYM(rb_intern((s))))
         
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
            void Init_commonmarker();
         
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
            #endif
         
     | 
    
        data/ext/commonmarker/config.h
    DELETED
    
    | 
         @@ -1,76 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            #ifndef CMARK_CONFIG_H
         
     | 
| 
       2 
     | 
    
         
            -
            #define CMARK_CONFIG_H
         
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
            #ifdef __cplusplus
         
     | 
| 
       5 
     | 
    
         
            -
            extern "C" {
         
     | 
| 
       6 
     | 
    
         
            -
            #endif
         
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
            #define HAVE_STDBOOL_H
         
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
            #ifdef HAVE_STDBOOL_H
         
     | 
| 
       11 
     | 
    
         
            -
              #include <stdbool.h>
         
     | 
| 
       12 
     | 
    
         
            -
            #elif !defined(__cplusplus)
         
     | 
| 
       13 
     | 
    
         
            -
              typedef char bool;
         
     | 
| 
       14 
     | 
    
         
            -
            #endif
         
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
            #define HAVE___BUILTIN_EXPECT
         
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
            #define HAVE___ATTRIBUTE__
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
            #ifdef HAVE___ATTRIBUTE__
         
     | 
| 
       21 
     | 
    
         
            -
              #define CMARK_ATTRIBUTE(list) __attribute__ (list)
         
     | 
| 
       22 
     | 
    
         
            -
            #else
         
     | 
| 
       23 
     | 
    
         
            -
              #define CMARK_ATTRIBUTE(list)
         
     | 
| 
       24 
     | 
    
         
            -
            #endif
         
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
            #ifndef CMARK_INLINE
         
     | 
| 
       27 
     | 
    
         
            -
              #if defined(_MSC_VER) && !defined(__cplusplus)
         
     | 
| 
       28 
     | 
    
         
            -
                #define CMARK_INLINE __inline
         
     | 
| 
       29 
     | 
    
         
            -
              #else
         
     | 
| 
       30 
     | 
    
         
            -
                #define CMARK_INLINE inline
         
     | 
| 
       31 
     | 
    
         
            -
              #endif
         
     | 
| 
       32 
     | 
    
         
            -
            #endif
         
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
            /* snprintf and vsnprintf fallbacks for MSVC before 2015,
         
     | 
| 
       35 
     | 
    
         
            -
               due to Valentin Milea http://stackoverflow.com/questions/2915672/
         
     | 
| 
       36 
     | 
    
         
            -
            */
         
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
       38 
     | 
    
         
            -
            #if defined(_MSC_VER) && _MSC_VER < 1900
         
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
       40 
     | 
    
         
            -
            #include <stdio.h>
         
     | 
| 
       41 
     | 
    
         
            -
            #include <stdarg.h>
         
     | 
| 
       42 
     | 
    
         
            -
             
     | 
| 
       43 
     | 
    
         
            -
            #define snprintf c99_snprintf
         
     | 
| 
       44 
     | 
    
         
            -
            #define vsnprintf c99_vsnprintf
         
     | 
| 
       45 
     | 
    
         
            -
             
     | 
| 
       46 
     | 
    
         
            -
            CMARK_INLINE int c99_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap)
         
     | 
| 
       47 
     | 
    
         
            -
            {
         
     | 
| 
       48 
     | 
    
         
            -
                int count = -1;
         
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
       50 
     | 
    
         
            -
                if (size != 0)
         
     | 
| 
       51 
     | 
    
         
            -
                    count = _vsnprintf_s(outBuf, size, _TRUNCATE, format, ap);
         
     | 
| 
       52 
     | 
    
         
            -
                if (count == -1)
         
     | 
| 
       53 
     | 
    
         
            -
                    count = _vscprintf(format, ap);
         
     | 
| 
       54 
     | 
    
         
            -
             
     | 
| 
       55 
     | 
    
         
            -
                return count;
         
     | 
| 
       56 
     | 
    
         
            -
            }
         
     | 
| 
       57 
     | 
    
         
            -
             
     | 
| 
       58 
     | 
    
         
            -
            CMARK_INLINE int c99_snprintf(char *outBuf, size_t size, const char *format, ...)
         
     | 
| 
       59 
     | 
    
         
            -
            {
         
     | 
| 
       60 
     | 
    
         
            -
                int count;
         
     | 
| 
       61 
     | 
    
         
            -
                va_list ap;
         
     | 
| 
       62 
     | 
    
         
            -
             
     | 
| 
       63 
     | 
    
         
            -
                va_start(ap, format);
         
     | 
| 
       64 
     | 
    
         
            -
                count = c99_vsnprintf(outBuf, size, format, ap);
         
     | 
| 
       65 
     | 
    
         
            -
                va_end(ap);
         
     | 
| 
       66 
     | 
    
         
            -
             
     | 
| 
       67 
     | 
    
         
            -
                return count;
         
     | 
| 
       68 
     | 
    
         
            -
            }
         
     | 
| 
       69 
     | 
    
         
            -
             
     | 
| 
       70 
     | 
    
         
            -
            #endif
         
     | 
| 
       71 
     | 
    
         
            -
             
     | 
| 
       72 
     | 
    
         
            -
            #ifdef __cplusplus
         
     | 
| 
       73 
     | 
    
         
            -
            }
         
     | 
| 
       74 
     | 
    
         
            -
            #endif
         
     | 
| 
       75 
     | 
    
         
            -
             
     | 
| 
       76 
     | 
    
         
            -
            #endif
         
     | 
| 
         @@ -1,27 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            #include "cmark-gfm-core-extensions.h"
         
     | 
| 
       2 
     | 
    
         
            -
            #include "autolink.h"
         
     | 
| 
       3 
     | 
    
         
            -
            #include "strikethrough.h"
         
     | 
| 
       4 
     | 
    
         
            -
            #include "table.h"
         
     | 
| 
       5 
     | 
    
         
            -
            #include "tagfilter.h"
         
     | 
| 
       6 
     | 
    
         
            -
            #include "tasklist.h"
         
     | 
| 
       7 
     | 
    
         
            -
            #include "registry.h"
         
     | 
| 
       8 
     | 
    
         
            -
            #include "plugin.h"
         
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
            static int core_extensions_registration(cmark_plugin *plugin) {
         
     | 
| 
       11 
     | 
    
         
            -
              cmark_plugin_register_syntax_extension(plugin, create_table_extension());
         
     | 
| 
       12 
     | 
    
         
            -
              cmark_plugin_register_syntax_extension(plugin,
         
     | 
| 
       13 
     | 
    
         
            -
                                                     create_strikethrough_extension());
         
     | 
| 
       14 
     | 
    
         
            -
              cmark_plugin_register_syntax_extension(plugin, create_autolink_extension());
         
     | 
| 
       15 
     | 
    
         
            -
              cmark_plugin_register_syntax_extension(plugin, create_tagfilter_extension());
         
     | 
| 
       16 
     | 
    
         
            -
              cmark_plugin_register_syntax_extension(plugin, create_tasklist_extension());
         
     | 
| 
       17 
     | 
    
         
            -
              return 1;
         
     | 
| 
       18 
     | 
    
         
            -
            }
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
            void cmark_gfm_core_extensions_ensure_registered(void) {
         
     | 
| 
       21 
     | 
    
         
            -
              static int registered = 0;
         
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
              if (!registered) {
         
     | 
| 
       24 
     | 
    
         
            -
                cmark_register_plugin(core_extensions_registration);
         
     | 
| 
       25 
     | 
    
         
            -
                registered = 1;
         
     | 
| 
       26 
     | 
    
         
            -
              }
         
     | 
| 
       27 
     | 
    
         
            -
            }
         
     |