kramdown 0.14.2 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of kramdown might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/CONTRIBUTERS +63 -1
- data/COPYING +17 -11
- data/README.md +35 -14
- data/VERSION +1 -1
- data/bin/kramdown +92 -40
- data/data/kramdown/document.html +4 -0
- data/data/kramdown/document.latex +7 -0
- data/lib/kramdown.rb +3 -16
- data/lib/kramdown/converter.rb +42 -16
- data/lib/kramdown/converter/base.rb +102 -38
- data/lib/kramdown/converter/hash_ast.rb +38 -0
- data/lib/kramdown/converter/html.rb +232 -141
- data/lib/kramdown/converter/kramdown.rb +122 -104
- data/lib/kramdown/converter/latex.rb +95 -78
- data/lib/kramdown/converter/man.rb +300 -0
- data/lib/kramdown/converter/math_engine/mathjax.rb +32 -0
- data/lib/kramdown/converter/remove_html_tags.rb +8 -17
- data/lib/kramdown/converter/syntax_highlighter.rb +56 -0
- data/lib/kramdown/converter/syntax_highlighter/minted.rb +35 -0
- data/lib/kramdown/converter/syntax_highlighter/rouge.rb +85 -0
- data/lib/kramdown/converter/toc.rb +7 -20
- data/lib/kramdown/document.rb +30 -37
- data/lib/kramdown/element.rb +54 -27
- data/lib/kramdown/error.rb +3 -16
- data/lib/kramdown/options.rb +392 -247
- data/lib/kramdown/parser.rb +3 -16
- data/lib/kramdown/parser/base.rb +28 -33
- data/lib/kramdown/parser/html.rb +151 -119
- data/lib/kramdown/parser/kramdown.rb +87 -50
- data/lib/kramdown/parser/kramdown/abbreviation.rb +33 -27
- data/lib/kramdown/parser/kramdown/autolink.rb +7 -25
- data/lib/kramdown/parser/kramdown/blank_line.rb +6 -19
- data/lib/kramdown/parser/kramdown/block_boundary.rb +6 -18
- data/lib/kramdown/parser/kramdown/blockquote.rb +6 -19
- data/lib/kramdown/parser/kramdown/codeblock.rb +15 -24
- data/lib/kramdown/parser/kramdown/codespan.rb +20 -22
- data/lib/kramdown/parser/kramdown/emphasis.rb +15 -24
- data/lib/kramdown/parser/kramdown/eob.rb +3 -16
- data/lib/kramdown/parser/kramdown/escaped_chars.rb +3 -16
- data/lib/kramdown/parser/kramdown/extensions.rb +66 -56
- data/lib/kramdown/parser/kramdown/footnote.rb +21 -31
- data/lib/kramdown/parser/kramdown/header.rb +37 -37
- data/lib/kramdown/parser/kramdown/horizontal_rule.rb +5 -17
- data/lib/kramdown/parser/kramdown/html.rb +47 -56
- data/lib/kramdown/parser/kramdown/html_entity.rb +9 -19
- data/lib/kramdown/parser/kramdown/line_break.rb +4 -17
- data/lib/kramdown/parser/kramdown/link.rb +39 -38
- data/lib/kramdown/parser/kramdown/list.rb +124 -82
- data/lib/kramdown/parser/kramdown/math.rb +12 -24
- data/lib/kramdown/parser/kramdown/paragraph.rb +23 -24
- data/lib/kramdown/parser/kramdown/smart_quotes.rb +26 -66
- data/lib/kramdown/parser/kramdown/table.rb +41 -48
- data/lib/kramdown/parser/kramdown/typographic_symbol.rb +14 -22
- data/lib/kramdown/parser/markdown.rb +11 -23
- data/lib/kramdown/utils.rb +21 -18
- data/lib/kramdown/utils/configurable.rb +45 -0
- data/lib/kramdown/utils/entities.rb +287 -292
- data/lib/kramdown/utils/html.rb +27 -30
- data/lib/kramdown/utils/lru_cache.rb +41 -0
- data/lib/kramdown/utils/string_scanner.rb +81 -0
- data/lib/kramdown/utils/unidecoder.rb +50 -0
- data/lib/kramdown/version.rb +4 -17
- data/man/man1/kramdown.1 +340 -347
- data/test/run_tests.rb +7 -20
- data/test/test_files.rb +188 -100
- data/test/test_location.rb +216 -0
- data/test/test_string_scanner_kramdown.rb +27 -0
- data/test/testcases/block/03_paragraph/indented.html.gfm +18 -0
- data/test/testcases/block/03_paragraph/line_break_last_line.html +9 -0
- data/test/testcases/block/03_paragraph/line_break_last_line.text +9 -0
- data/test/testcases/block/03_paragraph/standalone_image.html +8 -0
- data/test/testcases/block/03_paragraph/standalone_image.text +6 -0
- data/test/testcases/block/03_paragraph/with_html_to_native.html +1 -0
- data/test/testcases/block/03_paragraph/with_html_to_native.options +1 -0
- data/test/testcases/block/03_paragraph/with_html_to_native.text +1 -0
- data/test/testcases/block/04_header/atx_header.html +15 -1
- data/test/testcases/block/04_header/atx_header.text +14 -1
- data/test/testcases/block/04_header/setext_header.html +3 -1
- data/test/testcases/block/04_header/setext_header.text +4 -1
- data/test/testcases/block/04_header/with_auto_id_stripping.html +1 -0
- data/test/testcases/block/04_header/with_auto_id_stripping.options +1 -0
- data/test/testcases/block/04_header/with_auto_id_stripping.text +1 -0
- data/test/testcases/block/04_header/with_auto_ids.html +2 -0
- data/test/testcases/block/04_header/with_auto_ids.options +1 -0
- data/test/testcases/block/04_header/with_auto_ids.text +2 -0
- data/test/testcases/block/06_codeblock/guess_lang_css_class.html +15 -0
- data/test/testcases/block/06_codeblock/guess_lang_css_class.options +2 -0
- data/test/testcases/block/06_codeblock/guess_lang_css_class.text +13 -0
- data/test/testcases/block/06_codeblock/highlighting-minted-with-opts.latex +9 -0
- data/test/testcases/block/06_codeblock/highlighting-minted-with-opts.options +4 -0
- data/test/testcases/block/06_codeblock/highlighting-minted-with-opts.text +5 -0
- data/test/testcases/block/06_codeblock/highlighting-minted.latex +8 -0
- data/test/testcases/block/06_codeblock/highlighting-minted.options +3 -0
- data/test/testcases/block/06_codeblock/highlighting-minted.text +4 -0
- data/test/testcases/block/06_codeblock/highlighting-opts.html +6 -0
- data/test/testcases/block/06_codeblock/highlighting-opts.options +7 -0
- data/test/testcases/block/06_codeblock/highlighting-opts.text +4 -0
- data/test/testcases/block/06_codeblock/highlighting.html +5 -6
- data/test/testcases/block/06_codeblock/issue_gh45.html +164 -0
- data/test/testcases/block/06_codeblock/issue_gh45.test +188 -0
- data/test/testcases/block/06_codeblock/rouge/disabled.html +2 -0
- data/test/testcases/block/06_codeblock/rouge/disabled.options +4 -0
- data/test/testcases/block/06_codeblock/rouge/disabled.text +1 -0
- data/test/testcases/block/06_codeblock/rouge/multiple.html +11 -0
- data/test/testcases/block/06_codeblock/rouge/multiple.options +4 -0
- data/test/testcases/block/06_codeblock/rouge/multiple.text +11 -0
- data/test/testcases/block/06_codeblock/rouge/simple.html +10 -0
- data/test/testcases/block/06_codeblock/rouge/simple.options +3 -0
- data/test/testcases/block/06_codeblock/rouge/simple.text +9 -0
- data/test/testcases/block/06_codeblock/with_lang_in_fenced_block.options +1 -1
- data/test/testcases/block/06_codeblock/with_lang_in_fenced_block_any_char.html +8 -0
- data/test/testcases/block/06_codeblock/with_lang_in_fenced_block_any_char.options +2 -0
- data/test/testcases/block/06_codeblock/with_lang_in_fenced_block_any_char.text +11 -0
- data/test/testcases/block/06_codeblock/with_lang_in_fenced_block_name_with_dash.html +3 -0
- data/test/testcases/block/06_codeblock/with_lang_in_fenced_block_name_with_dash.options +2 -0
- data/test/testcases/block/06_codeblock/with_lang_in_fenced_block_name_with_dash.text +4 -0
- data/test/testcases/block/07_horizontal_rule/error.html +2 -2
- data/test/testcases/block/07_horizontal_rule/normal.html +2 -0
- data/test/testcases/block/07_horizontal_rule/normal.text +3 -0
- data/test/testcases/block/08_list/brackets_in_item.latex +3 -0
- data/test/testcases/block/08_list/brackets_in_item.text +1 -0
- data/test/testcases/block/08_list/lazy_and_nested.html +9 -0
- data/test/testcases/block/08_list/lazy_and_nested.text +4 -0
- data/test/testcases/block/09_html/html5_attributes.html +2 -0
- data/test/testcases/block/09_html/html5_attributes.text +2 -0
- data/test/testcases/block/09_html/html_after_block.html +7 -0
- data/test/testcases/block/09_html/html_after_block.text +5 -0
- data/test/testcases/block/09_html/html_to_native/table_simple.html +13 -0
- data/test/testcases/block/09_html/html_to_native/table_simple.text +15 -0
- data/test/testcases/block/09_html/html_to_native/typography.html +1 -1
- data/test/testcases/block/09_html/not_parsed.html +1 -1
- data/test/testcases/block/09_html/processing_instruction.html +5 -6
- data/test/testcases/block/09_html/simple.html +1 -5
- data/test/testcases/block/09_html/simple.text +1 -5
- data/test/testcases/block/09_html/standalone_image_in_div.htmlinput +7 -0
- data/test/testcases/block/09_html/standalone_image_in_div.text +8 -0
- data/test/testcases/block/09_html/textarea.html +8 -0
- data/test/testcases/block/09_html/textarea.text +8 -0
- data/test/testcases/block/09_html/xml.html +8 -0
- data/test/testcases/block/09_html/xml.text +7 -0
- data/test/testcases/block/11_ial/simple.html +5 -1
- data/test/testcases/block/11_ial/simple.text +8 -1
- data/test/testcases/block/12_extension/options.html +4 -4
- data/test/testcases/block/12_extension/options.text +2 -0
- data/test/testcases/block/12_extension/options2.html +4 -4
- data/test/testcases/block/12_extension/options3.html +7 -6
- data/test/testcases/block/12_extension/options3.text +2 -2
- data/test/testcases/block/13_definition_list/auto_ids.html +15 -0
- data/test/testcases/block/13_definition_list/auto_ids.text +18 -0
- data/test/testcases/block/13_definition_list/item_ial.html +5 -0
- data/test/testcases/block/13_definition_list/item_ial.text +8 -0
- data/test/testcases/block/14_table/empty_tag_in_cell.html +8 -0
- data/test/testcases/block/14_table/empty_tag_in_cell.options +1 -0
- data/test/testcases/block/14_table/empty_tag_in_cell.text +1 -0
- data/test/testcases/block/14_table/errors.html +4 -0
- data/test/testcases/block/14_table/errors.text +4 -0
- data/test/testcases/block/14_table/header.html +21 -0
- data/test/testcases/block/14_table/header.text +7 -0
- data/test/testcases/block/14_table/simple.html +22 -7
- data/test/testcases/block/14_table/simple.text +4 -0
- data/test/testcases/block/14_table/table_with_footnote.html +4 -4
- data/test/testcases/block/15_math/gh_128.html +1 -0
- data/test/testcases/block/15_math/gh_128.text +1 -0
- data/test/testcases/block/15_math/no_engine.html +3 -0
- data/test/testcases/block/15_math/no_engine.options +1 -0
- data/test/testcases/block/15_math/no_engine.text +2 -0
- data/test/testcases/block/15_math/normal.html +17 -14
- data/test/testcases/block/15_math/normal.text +2 -0
- data/test/testcases/block/16_toc/toc_exclude.html +7 -7
- data/test/testcases/block/16_toc/toc_levels.html +5 -5
- data/test/testcases/block/16_toc/toc_levels.text +1 -1
- data/test/testcases/block/16_toc/toc_with_footnotes.html +5 -5
- data/test/testcases/block/16_toc/toc_with_links.html +8 -0
- data/test/testcases/block/16_toc/toc_with_links.options +2 -0
- data/test/testcases/block/16_toc/toc_with_links.text +8 -0
- data/test/testcases/cjk-line-break.html +4 -0
- data/test/testcases/cjk-line-break.options +1 -0
- data/test/testcases/cjk-line-break.text +12 -0
- data/test/testcases/man/example.man +123 -0
- data/test/testcases/man/example.text +85 -0
- data/test/testcases/man/heading-name-dash-description.man +4 -0
- data/test/testcases/man/heading-name-dash-description.text +1 -0
- data/test/testcases/man/heading-name-description.man +4 -0
- data/test/testcases/man/heading-name-description.text +2 -0
- data/test/testcases/man/heading-name-section-description.man +4 -0
- data/test/testcases/man/heading-name-section-description.text +1 -0
- data/test/testcases/man/heading-name-section.man +2 -0
- data/test/testcases/man/heading-name-section.text +1 -0
- data/test/testcases/man/heading-name.man +2 -0
- data/test/testcases/man/heading-name.text +1 -0
- data/test/testcases/man/sections.man +4 -0
- data/test/testcases/man/sections.text +11 -0
- data/test/testcases/man/text-escaping.man +8 -0
- data/test/testcases/man/text-escaping.text +7 -0
- data/test/testcases/span/01_link/empty.html +1 -1
- data/test/testcases/span/01_link/empty_title.htmlinput +3 -0
- data/test/testcases/span/01_link/empty_title.text +7 -0
- data/test/testcases/span/01_link/imagelinks.html +1 -0
- data/test/testcases/span/01_link/imagelinks.text +2 -0
- data/test/testcases/span/01_link/inline.html +1 -1
- data/test/testcases/span/01_link/latex_escaping.latex +6 -0
- data/test/testcases/span/01_link/latex_escaping.text +5 -0
- data/test/testcases/span/01_link/link_defs.html +1 -1
- data/test/testcases/span/01_link/link_defs.text +2 -1
- data/test/testcases/span/01_link/link_defs_with_ial.html +4 -0
- data/test/testcases/span/01_link/link_defs_with_ial.text +16 -0
- data/test/testcases/span/01_link/reference.html +3 -3
- data/test/testcases/span/02_emphasis/nesting.html +3 -0
- data/test/testcases/span/02_emphasis/nesting.text +4 -1
- data/test/testcases/span/02_emphasis/normal.html +19 -0
- data/test/testcases/span/02_emphasis/normal.options +1 -0
- data/test/testcases/span/02_emphasis/normal.text +17 -0
- data/test/testcases/span/03_codespan/highlighting-minted.latex +2 -0
- data/test/testcases/span/03_codespan/highlighting-minted.options +1 -0
- data/test/testcases/span/03_codespan/highlighting-minted.text +1 -0
- data/test/testcases/span/03_codespan/highlighting.html +1 -1
- data/test/testcases/span/03_codespan/normal-css-class.html +1 -0
- data/test/testcases/span/03_codespan/normal-css-class.options +2 -0
- data/test/testcases/span/03_codespan/normal-css-class.text +1 -0
- data/test/testcases/span/03_codespan/rouge/disabled.html +1 -0
- data/test/testcases/span/03_codespan/rouge/disabled.options +4 -0
- data/test/testcases/span/03_codespan/rouge/disabled.text +1 -0
- data/test/testcases/span/03_codespan/rouge/simple.html +1 -0
- data/test/testcases/span/03_codespan/rouge/simple.options +1 -0
- data/test/testcases/span/03_codespan/rouge/simple.text +1 -0
- data/test/testcases/span/04_footnote/backlink_inline.html +79 -0
- data/test/testcases/span/04_footnote/backlink_inline.options +1 -0
- data/test/testcases/span/04_footnote/backlink_inline.text +38 -0
- data/test/testcases/span/04_footnote/backlink_text.html +9 -0
- data/test/testcases/span/04_footnote/backlink_text.options +1 -0
- data/test/testcases/span/04_footnote/backlink_text.text +3 -0
- data/test/testcases/span/04_footnote/definitions.latex +2 -2
- data/test/testcases/span/04_footnote/footnote_nr.html +6 -6
- data/test/testcases/span/04_footnote/footnote_prefix.html +12 -0
- data/test/testcases/span/04_footnote/footnote_prefix.options +1 -0
- data/test/testcases/span/04_footnote/footnote_prefix.text +4 -0
- data/test/testcases/span/04_footnote/inside_footnote.html +17 -0
- data/test/testcases/span/04_footnote/inside_footnote.text +9 -0
- data/test/testcases/span/04_footnote/markers.html +16 -16
- data/test/testcases/span/04_footnote/markers.latex +3 -3
- data/test/testcases/span/04_footnote/markers.options +2 -0
- data/test/testcases/span/04_footnote/markers.text +2 -1
- data/test/testcases/span/04_footnote/placement.html +11 -0
- data/test/testcases/span/04_footnote/placement.options +1 -0
- data/test/testcases/span/04_footnote/placement.text +8 -0
- data/test/testcases/span/04_footnote/regexp_problem.html +14 -0
- data/test/testcases/span/04_footnote/regexp_problem.options +2 -0
- data/test/testcases/span/04_footnote/regexp_problem.text +52 -0
- data/test/testcases/span/04_footnote/without_backlink.html +9 -0
- data/test/testcases/span/04_footnote/without_backlink.options +1 -0
- data/test/testcases/span/04_footnote/without_backlink.text +3 -0
- data/test/testcases/span/05_html/button.html +7 -0
- data/test/testcases/span/05_html/button.text +7 -0
- data/test/testcases/span/05_html/mark_element.html +3 -0
- data/test/testcases/span/05_html/mark_element.text +3 -0
- data/test/testcases/span/05_html/normal.html +10 -1
- data/test/testcases/span/05_html/normal.text +9 -0
- data/test/testcases/span/05_html/raw_span_elements.html +2 -0
- data/test/testcases/span/05_html/raw_span_elements.text +2 -0
- data/test/testcases/span/05_html/xml.html +5 -0
- data/test/testcases/span/05_html/xml.text +5 -0
- data/test/testcases/span/abbreviations/abbrev.html +14 -1
- data/test/testcases/span/abbreviations/abbrev.text +18 -2
- data/test/testcases/span/abbreviations/in_footnote.html +9 -0
- data/test/testcases/span/abbreviations/in_footnote.text +5 -0
- data/test/testcases/span/autolinks/url_links.html +5 -4
- data/test/testcases/span/autolinks/url_links.text +1 -0
- data/test/testcases/span/line_breaks/normal.html +2 -2
- data/test/testcases/span/line_breaks/normal.latex +2 -2
- data/test/testcases/span/math/no_engine.html +1 -0
- data/test/testcases/span/math/no_engine.options +1 -0
- data/test/testcases/span/math/no_engine.text +1 -0
- data/test/testcases/span/math/normal.html +4 -3
- data/test/testcases/span/math/normal.text +2 -1
- data/test/testcases/span/text_substitutions/entities_as_char.html +1 -1
- data/test/testcases/span/text_substitutions/entities_as_char.options +1 -0
- data/test/testcases/span/text_substitutions/entities_as_char.text +1 -1
- data/test/testcases/span/text_substitutions/typography.html +22 -0
- data/test/testcases/span/text_substitutions/typography.text +22 -0
- data/test/testcases/span/text_substitutions/typography_subst.html +3 -0
- data/test/testcases/span/text_substitutions/typography_subst.latex +4 -0
- data/test/testcases/span/text_substitutions/typography_subst.options +8 -0
- data/test/testcases/span/text_substitutions/typography_subst.text +3 -0
- metadata +218 -67
- data/ChangeLog +0 -7436
- data/GPL +0 -674
- data/Rakefile +0 -306
- data/benchmark/benchmark.rb +0 -36
- data/benchmark/benchmark.sh +0 -74
- data/benchmark/generate_data.rb +0 -119
- data/benchmark/mdbasics.text +0 -306
- data/benchmark/mdsyntax.text +0 -888
- data/benchmark/testing.sh +0 -9
- data/benchmark/timing.sh +0 -10
- data/doc/bg.png +0 -0
- data/doc/default.scss.css +0 -181
- data/doc/default.template +0 -68
- data/doc/design.scss.css +0 -441
- data/doc/documentation.page +0 -84
- data/doc/documentation.template +0 -20
- data/doc/index.page +0 -94
- data/doc/installation.page +0 -88
- data/doc/links.markdown +0 -6
- data/doc/metainfo +0 -3
- data/doc/news.feed +0 -10
- data/doc/news.page +0 -29
- data/doc/options.page +0 -10
- data/doc/quickref.page +0 -598
- data/doc/sidebar.template +0 -21
- data/doc/syntax.page +0 -1700
- data/doc/tests.page +0 -91
- data/doc/virtual +0 -2
- data/lib/kramdown/compatibility.rb +0 -49
- data/lib/kramdown/utils/ordered_hash.rb +0 -100
- data/setup.rb +0 -1585
- data/test/testcases/block/07_horizontal_rule/error.html.19 +0 -7
- data/test/testcases/block/09_html/html_to_native/typography.html.19 +0 -1
- data/test/testcases/block/09_html/simple.html.19 +0 -64
- data/test/testcases/block/14_table/simple.html.19 +0 -177
- data/test/testcases/span/01_link/inline.html.19 +0 -46
- data/test/testcases/span/01_link/reference.html.19 +0 -37
- data/test/testcases/span/text_substitutions/entities_as_char.html.19 +0 -1
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2a893196013756c877e4baa3d62eb2d3b862684748ed4f329a9723779e30bbeb
|
4
|
+
data.tar.gz: abfac14092805a87a5bdb0c7210ddb157b35a22391a8393a8401fdc547d2f902
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2fdb47e22271964a0a5caef5dc9054a6a5d50cfd81c01665ddfe9aa8e66539ce97125019bea46700ff54227602ce45fd3af98bd48824fe3460aefd6ce6ec3828
|
7
|
+
data.tar.gz: 9927a0d0fe778ac799dcd499727623c7bb35cc2a46a5745042c88d65685502d7bc04384c265155af214f046a2a27f72cf4b73b2d3ddba6a987de85939b6cfe56
|
data/CONTRIBUTERS
CHANGED
@@ -1,16 +1,78 @@
|
|
1
1
|
Count Name
|
2
2
|
======= ====
|
3
|
-
|
3
|
+
943 Thomas Leitner <t_leitner@gmx.at>
|
4
|
+
18 Ashwin Maroli <ashmaroli@gmail.com>
|
5
|
+
7 Christian Cornelssen <ccorn@1tein.de>
|
4
6
|
6 Gioele Barabucci <gioele@svario.it>
|
7
|
+
5 Gleb Mazovetskiy <glex.spb@gmail.com>
|
8
|
+
4 Ted Pak <powerpak006@gmail.com>
|
9
|
+
4 Shuanglei Tao <tsl0922@gmail.com>
|
10
|
+
4 Dan Allen <dan.j.allen@gmail.com>
|
11
|
+
4 Arne Brasseur <arne@arnebrasseur.net>
|
12
|
+
3 Henning Perl <perl@fast-sicher.de>
|
5
13
|
3 gettalong <t_leitner@gmx.at>
|
14
|
+
3 Brandur <brandur@mutelight.org>
|
6
15
|
3 Ben Armston <ben.armston@googlemail.com>
|
16
|
+
3 Ashwin Maroli <ashmaroli@users.noreply.github.com>
|
7
17
|
3 Alex Marandon <contact@alexmarandon.com>
|
18
|
+
2 Tom Thorogood <me+github@tomthorogood.co.uk>
|
19
|
+
2 Parker Moore <parkrmoore@gmail.com>
|
20
|
+
2 Nathanael Jones <nathanael.jones@gmail.com>
|
21
|
+
2 Max Meyer <dev@fedux.org>
|
22
|
+
2 Jo Hund <jhund@clearcove.ca>
|
8
23
|
2 Bran <m.versum@gmail.com>
|
24
|
+
1 winniehell <git@winniehell.de>
|
25
|
+
1 William <suttonwilliamd@gmail.com>
|
26
|
+
1 Uwe Kubosch <donv@users.noreply.github.com>
|
27
|
+
1 utenmiki <utenmiki@gmail.com>
|
28
|
+
1 Trevor Wennblom <trevor@well.com>
|
9
29
|
1 tomykaira <tomykaira@gmail.com>
|
30
|
+
1 tom93 <tomlevy93@gmail.com>
|
31
|
+
1 Tim Blair <tim@bla.ir>
|
32
|
+
1 Tim Besard <tim.besard@gmail.com>
|
10
33
|
1 Tim Bates <tim@rumpuslabs.com>
|
34
|
+
1 Sun Yaozhu <yzyzsun@gmail.com>
|
35
|
+
1 Stephen <stephengroat@users.noreply.github.com>
|
36
|
+
1 Stephen Crosby <stevecrozz@gmail.com>
|
37
|
+
1 Simon Lydell <simon.lydell@gmail.com>
|
38
|
+
1 Simon Coffey <simon.coffey@futurelearn.com>
|
39
|
+
1 Shusaku NAKAZATO <cu393uc@gmail.com>
|
40
|
+
1 Sebastian Boehm <sebastian@sometimesfood.org>
|
41
|
+
1 scherr <maximilianscherr@gmail.com>
|
11
42
|
1 Postmodern <postmodern.mod3@gmail.com>
|
43
|
+
1 Pete Michaud <michaudp@gmail.com>
|
44
|
+
1 Noah Doersing <doersino@gmail.com>
|
45
|
+
1 myqlarson <myqlarson@gmail.com>
|
46
|
+
1 milo.simpson <milo.simpson@bazaarvoice.com>
|
12
47
|
1 Michal Till <michal.till@gmail.com>
|
48
|
+
1 Maxime Kjaer <maxime.kjaer@gmail.com>
|
49
|
+
1 Matt Hickford <matt.hickford@gmail.com>
|
50
|
+
1 Martyn Chamberlin <martyn@perfectioncoding.com>
|
51
|
+
1 Marek Tuchowski <marek@tuchowski.com.pl>
|
52
|
+
1 Marcus Stollsteimer <sto.mar@web.de>
|
53
|
+
1 Luca Barbato <luca.barbato@gmail.com>
|
54
|
+
1 l3kn <hello@l3kn.de>
|
55
|
+
1 Kir Kolyshkin <kolyshkin@gmail.com>
|
56
|
+
1 Jun Aruga <jaruga@redhat.com>
|
57
|
+
1 Jonathan Hooper <jonathan.hooper@gsa.gov>
|
13
58
|
1 John Croisant <jacius@gmail.com>
|
14
59
|
1 Joe Fiorini <joe@faithfulgeek.org>
|
60
|
+
1 Jens Kraemer <jk@jkraemer.net>
|
61
|
+
1 Hirofumi Wakasugi <baenej@gmail.com>
|
62
|
+
1 Hector Correa <hector@hectorcorrea.com>
|
63
|
+
1 Florian Klampfer <f.klampfer@gmail.com>
|
64
|
+
1 Floreal Morandat florealm@gmail.com <florealm@gmail.com>
|
65
|
+
1 Fangyi Zhou <me@fangyi.io>
|
66
|
+
1 Diego Galeota <diegobg123@gmail.com>
|
67
|
+
1 David Rodríguez <deivid.rodriguez@riseup.net>
|
15
68
|
1 Damien Pollet <damien.pollet@gmail.com>
|
69
|
+
1 Christopher Jefferson <caj21@st-andrews.ac.uk>
|
70
|
+
1 Cédric Boutillier <cedric.boutillier@gmail.com>
|
71
|
+
1 Bob Lail <lail@squareup.com>
|
72
|
+
1 Ashe Connor <ashe@kivikakk.ee>
|
73
|
+
1 Antoine Cotten <hello@acotten.com>
|
74
|
+
1 Andrew <andrew.dale.wylie@gmail.com>
|
75
|
+
1 Alpha Chen <alpha.chen@gmail.com>
|
16
76
|
1 Alex Tomlins <alex.tomlins@digital.cabinet-office.gov.uk>
|
77
|
+
1 Alexey Vasiliev <le0pard@users.noreply.github.com>
|
78
|
+
1 284km <k.furuhashi10@gmail.com>
|
data/COPYING
CHANGED
@@ -1,18 +1,24 @@
|
|
1
1
|
kramdown - fast, pure-Ruby Markdown-superset converter
|
2
|
-
Copyright (C) 2009 Thomas Leitner <t_leitner@gmx.at>
|
2
|
+
Copyright (C) 2009-2013 Thomas Leitner <t_leitner@gmx.at>
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
5
|
+
copy of this software and associated documentation files (the
|
6
|
+
"Software"), to deal in the Software without restriction, including
|
7
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
the following conditions:
|
8
11
|
|
9
|
-
|
10
|
-
|
11
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
GNU General Public License for more details.
|
12
|
+
The above copyright notice and this permission notice shall be included
|
13
|
+
in all copies or substantial portions of the Software.
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
16
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
18
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
19
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
20
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
21
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
16
22
|
|
17
23
|
|
18
24
|
Some test cases and the benchmark files are based on test cases from
|
data/README.md
CHANGED
@@ -1,28 +1,46 @@
|
|
1
1
|
# kramdown
|
2
2
|
|
3
|
+
## Readme first!
|
4
|
+
|
5
|
+
kramdown was originally licensed under the GPL until the 1.0.0 release. However, due to the many
|
6
|
+
requests it is now released under the MIT license and therefore can easily be used in commercial
|
7
|
+
projects, too.
|
8
|
+
|
9
|
+
However, if you use kramdown in a commercial setting, please consider **contributing back any
|
10
|
+
changes** for the benefit of the community and/or
|
11
|
+
[**becoming a patron**](https://www.patreon.com/gettalong) - thanks!
|
12
|
+
|
13
|
+
|
3
14
|
## Introduction
|
4
15
|
|
5
|
-
kramdown is
|
16
|
+
kramdown is a fast, pure Ruby Markdown superset converter, using a strict syntax definition and
|
6
17
|
supporting several common extensions.
|
7
18
|
|
8
19
|
The syntax definition for the kramdown syntax can be found in **doc/syntax.page** (or online at
|
9
|
-
<http://kramdown.
|
10
|
-
**doc/quickref.page** or online at <http://kramdown.
|
20
|
+
<http://kramdown.gettalong.org/syntax.html>) and a quick reference is available in
|
21
|
+
**doc/quickref.page** or online at <http://kramdown.gettalong.org/quickref.html>.
|
11
22
|
|
12
23
|
The kramdown library is mainly written to support the kramdown-to-HTML conversion chain. However,
|
13
|
-
due to its flexibility it supports other input and output formats as
|
14
|
-
supported formats:
|
24
|
+
due to its flexibility (by creating an internal AST) it supports other input and output formats as
|
25
|
+
well. Here is a list of the supported formats:
|
15
26
|
|
16
|
-
* input formats: kramdown (a Markdown superset), Markdown, HTML
|
17
|
-
* output formats: HTML, kramdown, LaTeX (and therefore PDF)
|
27
|
+
* input formats: kramdown (a Markdown superset), Markdown, GFM, HTML
|
28
|
+
* output formats: HTML, kramdown, LaTeX (and therefore PDF), PDF via Prawn
|
18
29
|
|
19
30
|
All the documentation on the available input and output formats is available in the **doc/**
|
20
|
-
directory and online at <http://kramdown.
|
31
|
+
directory and online at <http://kramdown.gettalong.org>.
|
32
|
+
|
33
|
+
Starting from version 1.0.0 kramdown is using a versioning scheme with major, minor and patch parts
|
34
|
+
in the version number where the major number changes on backwards-incompatible changes, the minor
|
35
|
+
number on the introduction of new features and the patch number on everything else.
|
36
|
+
|
37
|
+
For information about changes between versions, have a look at
|
38
|
+
<http://kramdown.gettalong.org/news.html> or the commit history!
|
21
39
|
|
22
40
|
|
23
41
|
## Usage
|
24
42
|
|
25
|
-
kramdown has a
|
43
|
+
kramdown has a very simple API, so using kramdown is as easy as
|
26
44
|
|
27
45
|
```ruby
|
28
46
|
require 'kramdown'
|
@@ -32,19 +50,22 @@ Kramdown::Document.new(text).to_html
|
|
32
50
|
|
33
51
|
For detailed information have a look at the API documentation of the `Kramdown::Document` class.
|
34
52
|
|
35
|
-
The full API documentation is available at <http://kramdown.
|
53
|
+
The full API documentation is available at <http://kramdown.gettalong.org/rdoc/>, other sites with an
|
36
54
|
API documentation for kramdown probably don't provide the complete documentation!
|
37
55
|
|
56
|
+
There are also some third-party libraries that extend the functionality of kramdown -- see the
|
57
|
+
kramdown Wiki at <https://github.com/gettalong/kramdown/wiki>.
|
58
|
+
|
38
59
|
|
39
60
|
## Development
|
40
61
|
|
41
62
|
Just clone the git repository as described in **doc/installation.page** and you are good to go. You
|
42
|
-
probably want to install `rake` so that you can use the provided rake tasks.
|
63
|
+
probably want to install `rake` so that you can use the provided rake tasks.
|
43
64
|
|
44
|
-
|
45
|
-
|
65
|
+
If you want to run the tests, the development dependencies are needed as well as some additional
|
66
|
+
programs like `tidy` and `latex`. See the `.travis.yml` file for more information.
|
46
67
|
|
47
68
|
|
48
69
|
## License
|
49
70
|
|
50
|
-
|
71
|
+
MIT - see the **COPYING** file.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.3.0
|
data/bin/kramdown
CHANGED
@@ -2,41 +2,100 @@
|
|
2
2
|
# -*- coding: utf-8 -*-
|
3
3
|
#
|
4
4
|
#--
|
5
|
-
# Copyright (C) 2009-
|
5
|
+
# Copyright (C) 2009-2019 Thomas Leitner <t_leitner@gmx.at>
|
6
6
|
#
|
7
|
-
# This file is part of kramdown.
|
8
|
-
#
|
9
|
-
# kramdown is free software: you can redistribute it and/or modify
|
10
|
-
# it under the terms of the GNU General Public License as published by
|
11
|
-
# the Free Software Foundation, either version 3 of the License, or
|
12
|
-
# (at your option) any later version.
|
13
|
-
#
|
14
|
-
# This program is distributed in the hope that it will be useful,
|
15
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
-
# GNU General Public License for more details.
|
18
|
-
#
|
19
|
-
# You should have received a copy of the GNU General Public License
|
20
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
7
|
+
# This file is part of kramdown which is licensed under the MIT.
|
21
8
|
#++
|
22
9
|
#
|
23
10
|
|
24
11
|
require 'optparse'
|
12
|
+
require 'rbconfig'
|
13
|
+
require 'yaml'
|
25
14
|
require 'kramdown'
|
26
15
|
|
16
|
+
def add_kramdown_options(opts, parsed_options, banner: [], ignore: [])
|
17
|
+
banner_shown = false
|
18
|
+
defined_options = []
|
19
|
+
Kramdown::Options.definitions.sort.each do |n, definition|
|
20
|
+
next if ignore.include?(n)
|
21
|
+
|
22
|
+
unless banner_shown
|
23
|
+
opts.separator("")
|
24
|
+
banner.each {|part| opts.separator(part) }
|
25
|
+
opts.separator("")
|
26
|
+
banner_shown = true
|
27
|
+
end
|
28
|
+
|
29
|
+
defined_options << n
|
30
|
+
no = n.to_s.tr('_', '-')
|
31
|
+
if definition.type == Kramdown::Options::Boolean
|
32
|
+
opts.on("--[no-]#{no}") {|v| parsed_options[n] = Kramdown::Options.parse(n, v) }
|
33
|
+
else
|
34
|
+
type = definition.type
|
35
|
+
type = String if type == Symbol || type == Object
|
36
|
+
opts.on("--#{no} ARG", type) {|v| parsed_options[n] = Kramdown::Options.parse(n, v) }
|
37
|
+
end
|
38
|
+
|
39
|
+
definition.desc.split(/\n/).each do |line|
|
40
|
+
opts.separator opts.summary_indent + ' ' * 6 + line
|
41
|
+
end
|
42
|
+
opts.separator ''
|
43
|
+
end
|
44
|
+
defined_options
|
45
|
+
end
|
46
|
+
|
47
|
+
config_file = nil
|
48
|
+
begin
|
49
|
+
config_dir = case RbConfig::CONFIG['host_os']
|
50
|
+
when /bccwin|cygwin|djgpp|mingw|mswin|wince/i
|
51
|
+
File.expand_path((ENV['HOME'] || ENV['USERPROFILE'] || "~") + "/AppData/Local")
|
52
|
+
when /darwin|mac os/
|
53
|
+
File.expand_path("~/Library/Preferences/")
|
54
|
+
else
|
55
|
+
File.expand_path(ENV['XDG_CONFIG_HOME'] || '~/.config')
|
56
|
+
end
|
57
|
+
config_file = File.join(config_dir, "kramdownrc")
|
58
|
+
rescue StandardError
|
59
|
+
end
|
60
|
+
|
27
61
|
options = {}
|
28
62
|
format = ['html']
|
63
|
+
|
64
|
+
defined_options = []
|
29
65
|
OptionParser.new do |opts|
|
30
66
|
opts.banner = "Usage: kramdown [options] [FILE FILE ...]"
|
31
|
-
opts.summary_indent = ' '*4
|
67
|
+
opts.summary_indent = ' ' * 4
|
32
68
|
|
33
69
|
opts.separator ""
|
34
70
|
opts.separator "Command line options:"
|
35
71
|
opts.separator ""
|
36
72
|
|
37
|
-
opts.on("-i", "--input ARG", "Specify the input format: kramdown (default)
|
38
|
-
|
39
|
-
|
73
|
+
opts.on("-i", "--input ARG", "Specify the input format: kramdown (default), " \
|
74
|
+
"html, or markdown") {|v| options[:input] = v }
|
75
|
+
opts.on("-o", "--output ARG", Array, "Specify one or more output formats separated by commas: " \
|
76
|
+
"html (default),", "kramdown, latex, man or remove_html_tags") {|v| format = v }
|
77
|
+
opts.on("-x", "--extension EXT", Array, "Load one or more extensions (without the 'kramdown-' " \
|
78
|
+
"prefix) separated", "by commas (e.g. parser-gfm,syntax-coderay)",
|
79
|
+
"Note: Use this option before other options!") do |exts|
|
80
|
+
exts.each do |ext|
|
81
|
+
begin
|
82
|
+
require "kramdown-#{ext}"
|
83
|
+
new_options = add_kramdown_options(opts, options, banner: ["#{ext} options:"],
|
84
|
+
ignore: defined_options)
|
85
|
+
defined_options.concat(new_options)
|
86
|
+
rescue LoadError
|
87
|
+
$stderr.puts "Couldn't load extension #{ext}, ignoring"
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
opts.separator ""
|
92
|
+
opts.on("--no-config-file", "Do not read any configuration file. Default behavior is to check " \
|
93
|
+
"for a", "configuration file and read it if it exists.") { config_file = nil }
|
94
|
+
opts.on("--config-file FILE", "Specify the name of a configuration file with kramdown options " \
|
95
|
+
"in YAML", "format, e.g. \"auto_id_prefix: ARG\" instead of \"--auto-id-prefix ARG\"",
|
96
|
+
"and \"auto_ids: false\" instead of \"--no-auto-ids\".",
|
97
|
+
"Default: #{config_file}") {|v| config_file = v }
|
98
|
+
opts.separator ""
|
40
99
|
opts.on("-v", "--version", "Show the version of kramdown") do
|
41
100
|
puts Kramdown::VERSION
|
42
101
|
exit
|
@@ -46,34 +105,27 @@ OptionParser.new do |opts|
|
|
46
105
|
exit
|
47
106
|
end
|
48
107
|
|
49
|
-
opts
|
50
|
-
|
51
|
-
|
108
|
+
new_options = add_kramdown_options(opts, options, banner: ["kramdown options:"])
|
109
|
+
defined_options.concat(new_options)
|
110
|
+
end.parse!
|
52
111
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
112
|
+
begin
|
113
|
+
if config_file && File.exist?(config_file)
|
114
|
+
config_file_options = YAML.safe_load(File.read(config_file), [Symbol])
|
115
|
+
case config_file_options
|
116
|
+
when nil # empty configuration file except perhaps YAML header and comments
|
117
|
+
# Nothing to do
|
118
|
+
when Hash
|
119
|
+
options = config_file_options.merge(options)
|
57
120
|
else
|
58
|
-
|
59
|
-
type = String if type == Symbol || type == Object
|
60
|
-
opts.on("--#{no} ARG", type) {|v| options[n] = Kramdown::Options.parse(n, v)}
|
61
|
-
end
|
62
|
-
|
63
|
-
definition.desc.split(/\n/).each do |line|
|
64
|
-
opts.separator opts.summary_indent + ' '*6 + line
|
121
|
+
raise Kramdown::Error, "No YAML map in configuration file \"#{config_file}\""
|
65
122
|
end
|
66
|
-
opts.separator ''
|
67
123
|
end
|
68
|
-
|
69
|
-
end.parse!
|
70
|
-
|
71
|
-
begin
|
72
124
|
doc = Kramdown::Document.new(ARGF.read, options)
|
73
125
|
result = ''
|
74
|
-
format.each {|f| result = doc.send("to_#{f}")}
|
126
|
+
format.each {|f| result = doc.send("to_#{f}") }
|
75
127
|
puts result
|
76
|
-
doc.warnings.each {|warn| $stderr.puts "Warning: #{warn}"}
|
128
|
+
doc.warnings.each {|warn| $stderr.puts "Warning: #{warn}" }
|
77
129
|
rescue Kramdown::Error => e
|
78
130
|
$stderr.puts "Error: #{e.message}"
|
79
131
|
exit(1)
|
data/data/kramdown/document.html
CHANGED
@@ -36,6 +36,13 @@ encmap = {
|
|
36
36
|
\VerbatimFootnotes
|
37
37
|
<% end %>
|
38
38
|
|
39
|
+
<% if @converter.data[:packages].include?('acronym') %>
|
40
|
+
<% @converter.root.options[:abbrev_defs].each_pair do |k,v| %>\acrodef{<%= @converter.normalize_abbreviation_key(k) %>}[<%= k %>]{<%= @converter.escape(v) %>}
|
41
|
+
<% end %>
|
42
|
+
<% end %>
|
43
|
+
|
44
|
+
\setcounter{footnote}{<%= @converter.options[:footnote_nr] - 1 %>}
|
45
|
+
|
39
46
|
\hypersetup{colorlinks=true,urlcolor=blue}
|
40
47
|
|
41
48
|
\begin{document}
|
data/lib/kramdown.rb
CHANGED
@@ -1,22 +1,9 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
1
|
+
# -*- coding: utf-8; frozen_string_literal: true -*-
|
2
2
|
#
|
3
3
|
#--
|
4
|
-
# Copyright (C) 2009-
|
4
|
+
# Copyright (C) 2009-2019 Thomas Leitner <t_leitner@gmx.at>
|
5
5
|
#
|
6
|
-
# This file is part of kramdown.
|
7
|
-
#
|
8
|
-
# kramdown is free software: you can redistribute it and/or modify
|
9
|
-
# it under the terms of the GNU General Public License as published by
|
10
|
-
# the Free Software Foundation, either version 3 of the License, or
|
11
|
-
# (at your option) any later version.
|
12
|
-
#
|
13
|
-
# This program is distributed in the hope that it will be useful,
|
14
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
-
# GNU General Public License for more details.
|
17
|
-
#
|
18
|
-
# You should have received a copy of the GNU General Public License
|
19
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
6
|
+
# This file is part of kramdown which is licensed under the MIT.
|
20
7
|
#++
|
21
8
|
#
|
22
9
|
|
data/lib/kramdown/converter.rb
CHANGED
@@ -1,25 +1,14 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
1
|
+
# -*- coding: utf-8; frozen_string_literal: true -*-
|
2
2
|
#
|
3
3
|
#--
|
4
|
-
# Copyright (C) 2009-
|
4
|
+
# Copyright (C) 2009-2019 Thomas Leitner <t_leitner@gmx.at>
|
5
5
|
#
|
6
|
-
# This file is part of kramdown.
|
7
|
-
#
|
8
|
-
# kramdown is free software: you can redistribute it and/or modify
|
9
|
-
# it under the terms of the GNU General Public License as published by
|
10
|
-
# the Free Software Foundation, either version 3 of the License, or
|
11
|
-
# (at your option) any later version.
|
12
|
-
#
|
13
|
-
# This program is distributed in the hope that it will be useful,
|
14
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
-
# GNU General Public License for more details.
|
17
|
-
#
|
18
|
-
# You should have received a copy of the GNU General Public License
|
19
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
6
|
+
# This file is part of kramdown which is licensed under the MIT.
|
20
7
|
#++
|
21
8
|
#
|
22
9
|
|
10
|
+
require 'kramdown/utils'
|
11
|
+
|
23
12
|
module Kramdown
|
24
13
|
|
25
14
|
# This module contains all available converters, i.e. classes that take a root Element and convert
|
@@ -36,6 +25,43 @@ module Kramdown
|
|
36
25
|
autoload :Kramdown, 'kramdown/converter/kramdown'
|
37
26
|
autoload :Toc, 'kramdown/converter/toc'
|
38
27
|
autoload :RemoveHtmlTags, 'kramdown/converter/remove_html_tags'
|
28
|
+
autoload :HashAST, 'kramdown/converter/hash_ast'
|
29
|
+
autoload :HashAst, 'kramdown/converter/hash_ast'
|
30
|
+
autoload :Man, 'kramdown/converter/man'
|
31
|
+
|
32
|
+
extend ::Kramdown::Utils::Configurable
|
33
|
+
|
34
|
+
configurable(:syntax_highlighter)
|
35
|
+
|
36
|
+
['Minted', "Rouge"].each do |klass_name|
|
37
|
+
kn_down = klass_name.downcase.intern
|
38
|
+
add_syntax_highlighter(kn_down) do |converter, text, lang, type, opts|
|
39
|
+
require "kramdown/converter/syntax_highlighter/#{kn_down}"
|
40
|
+
klass = ::Kramdown::Utils.deep_const_get("::Kramdown::Converter::SyntaxHighlighter::#{klass_name}")
|
41
|
+
if !klass.const_defined?(:AVAILABLE) || klass::AVAILABLE
|
42
|
+
add_syntax_highlighter(kn_down, klass)
|
43
|
+
else
|
44
|
+
add_syntax_highlighter(kn_down) { nil }
|
45
|
+
end
|
46
|
+
syntax_highlighter(kn_down).call(converter, text, lang, type, opts)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
configurable(:math_engine)
|
51
|
+
|
52
|
+
["Mathjax"].each do |klass_name|
|
53
|
+
kn_down = klass_name.downcase.intern
|
54
|
+
add_math_engine(kn_down) do |converter, el, opts|
|
55
|
+
require "kramdown/converter/math_engine/#{kn_down}"
|
56
|
+
klass = ::Kramdown::Utils.deep_const_get("::Kramdown::Converter::MathEngine::#{klass_name}")
|
57
|
+
if !klass.const_defined?(:AVAILABLE) || klass::AVAILABLE
|
58
|
+
add_math_engine(kn_down, klass)
|
59
|
+
else
|
60
|
+
add_math_engine(kn_down) { nil }
|
61
|
+
end
|
62
|
+
math_engine(kn_down).call(converter, el, opts)
|
63
|
+
end
|
64
|
+
end
|
39
65
|
|
40
66
|
end
|
41
67
|
|