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
@@ -1,26 +1,13 @@
|
|
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
|
|
23
|
-
require 'kramdown/parser
|
10
|
+
require 'kramdown/parser'
|
24
11
|
|
25
12
|
module Kramdown
|
26
13
|
|
@@ -38,25 +25,26 @@ module Kramdown
|
|
38
25
|
class Markdown < Kramdown
|
39
26
|
|
40
27
|
# Array with all the parsing methods that should be removed from the standard kramdown parser.
|
41
|
-
EXTENDED = [:codeblock_fenced, :table, :definition_list, :footnote_definition,
|
42
|
-
:block_extensions,
|
28
|
+
EXTENDED = [:codeblock_fenced, :table, :definition_list, :footnote_definition,
|
29
|
+
:abbrev_definition, :block_math, :block_extensions,
|
43
30
|
:footnote_marker, :smart_quotes, :inline_math, :span_extensions, :typographic_syms]
|
44
31
|
|
45
32
|
def initialize(source, options) # :nodoc:
|
46
33
|
super
|
47
|
-
@block_parsers.delete_if {|i| EXTENDED.include?(i)}
|
48
|
-
@span_parsers.delete_if {|i| EXTENDED.include?(i)}
|
34
|
+
@block_parsers.delete_if {|i| EXTENDED.include?(i) }
|
35
|
+
@span_parsers.delete_if {|i| EXTENDED.include?(i) }
|
49
36
|
end
|
50
37
|
|
51
38
|
# :stopdoc:
|
52
39
|
|
53
40
|
BLOCK_BOUNDARY = /#{BLANK_LINE}|#{EOB_MARKER}|\Z/
|
54
|
-
LAZY_END = /#{BLANK_LINE}|#{EOB_MARKER}|^#{OPT_SPACE}#{LAZY_END_HTML_STOP}
|
41
|
+
LAZY_END = /#{BLANK_LINE}|#{EOB_MARKER}|^#{OPT_SPACE}#{LAZY_END_HTML_STOP}|
|
42
|
+
^#{OPT_SPACE}#{LAZY_END_HTML_START}|\Z/x
|
55
43
|
CODEBLOCK_MATCH = /(?:#{BLANK_LINE}?(?:#{INDENT}[ \t]*\S.*\n)+)*/
|
56
44
|
PARAGRAPH_END = LAZY_END
|
57
45
|
|
58
46
|
IAL_RAND_CHARS = (('a'..'z').to_a + ('0'..'9').to_a)
|
59
|
-
IAL_RAND_STRING = (1..20).collect {
|
47
|
+
IAL_RAND_STRING = (1..20).collect { IAL_RAND_CHARS[rand(IAL_RAND_CHARS.size)] }.join
|
60
48
|
LIST_ITEM_IAL = /^\s*(#{IAL_RAND_STRING})?\s*\n/
|
61
49
|
IAL_SPAN_START = LIST_ITEM_IAL
|
62
50
|
|
data/lib/kramdown/utils.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
|
|
@@ -30,11 +17,27 @@ module Kramdown
|
|
30
17
|
|
31
18
|
autoload :Entities, 'kramdown/utils/entities'
|
32
19
|
autoload :Html, 'kramdown/utils/html'
|
33
|
-
autoload :
|
20
|
+
autoload :Unidecoder, 'kramdown/utils/unidecoder'
|
21
|
+
autoload :StringScanner, 'kramdown/utils/string_scanner'
|
22
|
+
autoload :Configurable, 'kramdown/utils/configurable'
|
23
|
+
autoload :LRUCache, 'kramdown/utils/lru_cache'
|
34
24
|
|
35
25
|
# Treat +name+ as if it were snake cased (e.g. snake_case) and camelize it (e.g. SnakeCase).
|
36
26
|
def self.camelize(name)
|
37
|
-
name.split('_').inject('') {|s,x| s << x[0..0].upcase
|
27
|
+
name.split('_').inject(+'') {|s, x| s << x[0..0].upcase << x[1..-1] }
|
28
|
+
end
|
29
|
+
|
30
|
+
# Treat +name+ as if it were camelized (e.g. CamelizedName) and snake-case it (e.g. camelized_name).
|
31
|
+
def self.snake_case(name)
|
32
|
+
name = name.dup
|
33
|
+
name.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
34
|
+
name.gsub!(/([a-z])([A-Z])/, '\1_\2')
|
35
|
+
name.downcase!
|
36
|
+
name
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.deep_const_get(str)
|
40
|
+
::Object.const_get(str)
|
38
41
|
end
|
39
42
|
|
40
43
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# -*- coding: utf-8; frozen_string_literal: true -*-
|
2
|
+
#
|
3
|
+
#--
|
4
|
+
# Copyright (C) 2009-2019 Thomas Leitner <t_leitner@gmx.at>
|
5
|
+
#
|
6
|
+
# This file is part of kramdown which is licensed under the MIT.
|
7
|
+
#++
|
8
|
+
#
|
9
|
+
|
10
|
+
module Kramdown
|
11
|
+
module Utils
|
12
|
+
|
13
|
+
# Methods for registering configurable extensions.
|
14
|
+
module Configurable
|
15
|
+
|
16
|
+
# Create a new configurable extension called +name+.
|
17
|
+
#
|
18
|
+
# Three methods will be defined on the calling object which allow to use this configurable
|
19
|
+
# extension:
|
20
|
+
#
|
21
|
+
# configurables:: Returns a hash of hashes that is used to store all configurables of the
|
22
|
+
# object.
|
23
|
+
#
|
24
|
+
# <name>(ext_name):: Return the configured extension +ext_name+.
|
25
|
+
#
|
26
|
+
# add_<name>(ext_name, data=nil, &block):: Define an extension +ext_name+ by specifying either
|
27
|
+
# the data as argument or by using a block.
|
28
|
+
def configurable(name)
|
29
|
+
unless respond_to?(:configurables)
|
30
|
+
singleton_class.send(:define_method, :configurables) do
|
31
|
+
@_configurables ||= Hash.new {|h, k| h[k] = {} }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
singleton_class.send(:define_method, name) do |data|
|
35
|
+
configurables[name][data]
|
36
|
+
end
|
37
|
+
singleton_class.send(:define_method, "add_#{name}".intern) do |data, *args, &block|
|
38
|
+
configurables[name][data] = args.first || block
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
@@ -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
|
|
@@ -28,13 +15,11 @@ module Kramdown
|
|
28
15
|
module Entities
|
29
16
|
|
30
17
|
# Represents an entity that has a +code_point+ and +name+.
|
31
|
-
|
32
|
-
|
18
|
+
Entity = Struct.new(:code_point, :name) do
|
33
19
|
# Return the UTF8 representation of the entity.
|
34
20
|
def char
|
35
21
|
[code_point].pack('U*') rescue nil
|
36
22
|
end
|
37
|
-
|
38
23
|
end
|
39
24
|
|
40
25
|
# Array of arrays. Each sub-array specifies a code point and the associated name.
|
@@ -42,283 +27,294 @@ module Kramdown
|
|
42
27
|
# This table is not used directly -- Entity objects are automatically created from it and put
|
43
28
|
# into a Hash map when this file is loaded.
|
44
29
|
ENTITY_TABLE = [
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
30
|
+
[913, 'Alpha'],
|
31
|
+
[914, 'Beta'],
|
32
|
+
[915, 'Gamma'],
|
33
|
+
[916, 'Delta'],
|
34
|
+
[917, 'Epsilon'],
|
35
|
+
[918, 'Zeta'],
|
36
|
+
[919, 'Eta'],
|
37
|
+
[920, 'Theta'],
|
38
|
+
[921, 'Iota'],
|
39
|
+
[922, 'Kappa'],
|
40
|
+
[923, 'Lambda'],
|
41
|
+
[924, 'Mu'],
|
42
|
+
[925, 'Nu'],
|
43
|
+
[926, 'Xi'],
|
44
|
+
[927, 'Omicron'],
|
45
|
+
[928, 'Pi'],
|
46
|
+
[929, 'Rho'],
|
47
|
+
[931, 'Sigma'],
|
48
|
+
[932, 'Tau'],
|
49
|
+
[933, 'Upsilon'],
|
50
|
+
[934, 'Phi'],
|
51
|
+
[935, 'Chi'],
|
52
|
+
[936, 'Psi'],
|
53
|
+
[937, 'Omega'],
|
54
|
+
[945, 'alpha'],
|
55
|
+
[946, 'beta'],
|
56
|
+
[947, 'gamma'],
|
57
|
+
[948, 'delta'],
|
58
|
+
[949, 'epsilon'],
|
59
|
+
[950, 'zeta'],
|
60
|
+
[951, 'eta'],
|
61
|
+
[952, 'theta'],
|
62
|
+
[953, 'iota'],
|
63
|
+
[954, 'kappa'],
|
64
|
+
[955, 'lambda'],
|
65
|
+
[956, 'mu'],
|
66
|
+
[957, 'nu'],
|
67
|
+
[958, 'xi'],
|
68
|
+
[959, 'omicron'],
|
69
|
+
[960, 'pi'],
|
70
|
+
[961, 'rho'],
|
71
|
+
[963, 'sigma'],
|
72
|
+
[964, 'tau'],
|
73
|
+
[965, 'upsilon'],
|
74
|
+
[966, 'phi'],
|
75
|
+
[967, 'chi'],
|
76
|
+
[968, 'psi'],
|
77
|
+
[969, 'omega'],
|
78
|
+
[962, 'sigmaf'],
|
79
|
+
[977, 'thetasym'],
|
80
|
+
[978, 'upsih'],
|
81
|
+
[982, 'piv'],
|
82
|
+
[8204, 'zwnj'],
|
83
|
+
[8205, 'zwj'],
|
84
|
+
[8206, 'lrm'],
|
85
|
+
[8207, 'rlm'],
|
86
|
+
[8230, 'hellip'],
|
87
|
+
[8242, 'prime'],
|
88
|
+
[8243, 'Prime'],
|
89
|
+
[8254, 'oline'],
|
90
|
+
[8260, 'frasl'],
|
91
|
+
[8472, 'weierp'],
|
92
|
+
[8465, 'image'],
|
93
|
+
[8476, 'real'],
|
94
|
+
[8501, 'alefsym'],
|
95
|
+
[8226, 'bull'],
|
96
|
+
[8482, 'trade'],
|
97
|
+
[8592, 'larr'],
|
98
|
+
[8594, 'rarr'],
|
99
|
+
[8593, 'uarr'],
|
100
|
+
[8595, 'darr'],
|
101
|
+
[8596, 'harr'],
|
102
|
+
[8629, 'crarr'],
|
103
|
+
[8657, 'uArr'],
|
104
|
+
[8659, 'dArr'],
|
105
|
+
[8656, 'lArr'],
|
106
|
+
[8658, 'rArr'],
|
107
|
+
[8660, 'hArr'],
|
108
|
+
[8704, 'forall'],
|
109
|
+
[8706, 'part'],
|
110
|
+
[8707, 'exist'],
|
111
|
+
[8709, 'empty'],
|
112
|
+
[8711, 'nabla'],
|
113
|
+
[8712, 'isin'],
|
114
|
+
[8715, 'ni'],
|
115
|
+
[8713, 'notin'],
|
116
|
+
[8721, 'sum'],
|
117
|
+
[8719, 'prod'],
|
118
|
+
[8722, 'minus'],
|
119
|
+
[8727, 'lowast'],
|
120
|
+
[8730, 'radic'],
|
121
|
+
[8733, 'prop'],
|
122
|
+
[8734, 'infin'],
|
123
|
+
[8736, 'ang'],
|
124
|
+
[8743, 'and'],
|
125
|
+
[8744, 'or'],
|
126
|
+
[8745, 'cap'],
|
127
|
+
[8746, 'cup'],
|
128
|
+
[8747, 'int'],
|
129
|
+
[8756, 'there4'],
|
130
|
+
[8764, 'sim'],
|
131
|
+
[8776, 'asymp'],
|
132
|
+
[8773, 'cong'],
|
133
|
+
[8800, 'ne'],
|
134
|
+
[8801, 'equiv'],
|
135
|
+
[8804, 'le'],
|
136
|
+
[8805, 'ge'],
|
137
|
+
[8834, 'sub'],
|
138
|
+
[8835, 'sup'],
|
139
|
+
[8838, 'sube'],
|
140
|
+
[8839, 'supe'],
|
141
|
+
[8836, 'nsub'],
|
142
|
+
[8853, 'oplus'],
|
143
|
+
[8855, 'otimes'],
|
144
|
+
[8869, 'perp'],
|
145
|
+
[8901, 'sdot'],
|
146
|
+
[8942, 'vellip'],
|
147
|
+
[8968, 'rceil'],
|
148
|
+
[8969, 'lceil'],
|
149
|
+
[8970, 'lfloor'],
|
150
|
+
[8971, 'rfloor'],
|
151
|
+
[9001, 'rang'],
|
152
|
+
[9002, 'lang'],
|
153
|
+
[9674, 'loz'],
|
154
|
+
[9824, 'spades'],
|
155
|
+
[9827, 'clubs'],
|
156
|
+
[9829, 'hearts'],
|
157
|
+
[9830, 'diams'],
|
158
|
+
[38, 'amp'],
|
159
|
+
[34, 'quot'],
|
160
|
+
[39, 'apos'],
|
161
|
+
[169, 'copy'],
|
162
|
+
[60, 'lt'],
|
163
|
+
[62, 'gt'],
|
164
|
+
[338, 'OElig'],
|
165
|
+
[339, 'oelig'],
|
166
|
+
[352, 'Scaron'],
|
167
|
+
[353, 'scaron'],
|
168
|
+
[376, 'Yuml'],
|
169
|
+
[710, 'circ'],
|
170
|
+
[732, 'tilde'],
|
171
|
+
[8211, 'ndash'],
|
172
|
+
[8212, 'mdash'],
|
173
|
+
[8216, 'lsquo'],
|
174
|
+
[8217, 'rsquo'],
|
175
|
+
[8220, 'ldquo'],
|
176
|
+
[8221, 'rdquo'],
|
177
|
+
[8224, 'dagger'],
|
178
|
+
[8225, 'Dagger'],
|
179
|
+
[8240, 'permil'],
|
180
|
+
[8364, 'euro'],
|
181
|
+
[8249, 'lsaquo'],
|
182
|
+
[8250, 'rsaquo'],
|
183
|
+
[160, 'nbsp'],
|
184
|
+
[161, 'iexcl'],
|
185
|
+
[163, 'pound'],
|
186
|
+
[164, 'curren'],
|
187
|
+
[165, 'yen'],
|
188
|
+
[166, 'brvbar'],
|
189
|
+
[167, 'sect'],
|
190
|
+
[168, 'uml'],
|
191
|
+
[171, 'laquo'],
|
192
|
+
[187, 'raquo'],
|
193
|
+
[174, 'reg'],
|
194
|
+
[170, 'ordf'],
|
195
|
+
[172, 'not'],
|
196
|
+
[173, 'shy'],
|
197
|
+
[175, 'macr'],
|
198
|
+
[176, 'deg'],
|
199
|
+
[177, 'plusmn'],
|
200
|
+
[180, 'acute'],
|
201
|
+
[181, 'micro'],
|
202
|
+
[182, 'para'],
|
203
|
+
[183, 'middot'],
|
204
|
+
[184, 'cedil'],
|
205
|
+
[186, 'ordm'],
|
206
|
+
[162, 'cent'],
|
207
|
+
[185, 'sup1'],
|
208
|
+
[178, 'sup2'],
|
209
|
+
[179, 'sup3'],
|
210
|
+
[189, 'frac12'],
|
211
|
+
[188, 'frac14'],
|
212
|
+
[190, 'frac34'],
|
213
|
+
[191, 'iquest'],
|
214
|
+
[192, 'Agrave'],
|
215
|
+
[193, 'Aacute'],
|
216
|
+
[194, 'Acirc'],
|
217
|
+
[195, 'Atilde'],
|
218
|
+
[196, 'Auml'],
|
219
|
+
[197, 'Aring'],
|
220
|
+
[198, 'AElig'],
|
221
|
+
[199, 'Ccedil'],
|
222
|
+
[200, 'Egrave'],
|
223
|
+
[201, 'Eacute'],
|
224
|
+
[202, 'Ecirc'],
|
225
|
+
[203, 'Euml'],
|
226
|
+
[204, 'Igrave'],
|
227
|
+
[205, 'Iacute'],
|
228
|
+
[206, 'Icirc'],
|
229
|
+
[207, 'Iuml'],
|
230
|
+
[208, 'ETH'],
|
231
|
+
[209, 'Ntilde'],
|
232
|
+
[210, 'Ograve'],
|
233
|
+
[211, 'Oacute'],
|
234
|
+
[212, 'Ocirc'],
|
235
|
+
[213, 'Otilde'],
|
236
|
+
[214, 'Ouml'],
|
237
|
+
[215, 'times'],
|
238
|
+
[216, 'Oslash'],
|
239
|
+
[217, 'Ugrave'],
|
240
|
+
[218, 'Uacute'],
|
241
|
+
[219, 'Ucirc'],
|
242
|
+
[220, 'Uuml'],
|
243
|
+
[221, 'Yacute'],
|
244
|
+
[222, 'THORN'],
|
245
|
+
[223, 'szlig'],
|
246
|
+
[224, 'agrave'],
|
247
|
+
[225, 'aacute'],
|
248
|
+
[226, 'acirc'],
|
249
|
+
[227, 'atilde'],
|
250
|
+
[228, 'auml'],
|
251
|
+
[229, 'aring'],
|
252
|
+
[230, 'aelig'],
|
253
|
+
[231, 'ccedil'],
|
254
|
+
[232, 'egrave'],
|
255
|
+
[233, 'eacute'],
|
256
|
+
[234, 'ecirc'],
|
257
|
+
[235, 'euml'],
|
258
|
+
[236, 'igrave'],
|
259
|
+
[237, 'iacute'],
|
260
|
+
[238, 'icirc'],
|
261
|
+
[239, 'iuml'],
|
262
|
+
[240, 'eth'],
|
263
|
+
[241, 'ntilde'],
|
264
|
+
[242, 'ograve'],
|
265
|
+
[243, 'oacute'],
|
266
|
+
[244, 'ocirc'],
|
267
|
+
[245, 'otilde'],
|
268
|
+
[246, 'ouml'],
|
269
|
+
[247, 'divide'],
|
270
|
+
[248, 'oslash'],
|
271
|
+
[249, 'ugrave'],
|
272
|
+
[250, 'uacute'],
|
273
|
+
[251, 'ucirc'],
|
274
|
+
[252, 'uuml'],
|
275
|
+
[253, 'yacute'],
|
276
|
+
[254, 'thorn'],
|
277
|
+
[255, 'yuml'],
|
282
278
|
|
283
|
-
|
284
|
-
|
285
|
-
|
279
|
+
[8218, 'sbquo'],
|
280
|
+
[402, 'fnof'],
|
281
|
+
[8222, 'bdquo'],
|
286
282
|
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
283
|
+
[128, 8364],
|
284
|
+
[130, 8218],
|
285
|
+
[131, 402],
|
286
|
+
[132, 8222],
|
287
|
+
[133, 8230],
|
288
|
+
[134, 8224],
|
289
|
+
[135, 8225],
|
290
|
+
[136, 710],
|
291
|
+
[137, 8240],
|
292
|
+
[138, 352],
|
293
|
+
[139, 8249],
|
294
|
+
[140, 338],
|
295
|
+
[142, 381],
|
296
|
+
[145, 8216],
|
297
|
+
[146, 8217],
|
298
|
+
[147, 8220],
|
299
|
+
[148, 8221],
|
300
|
+
[149, 8226],
|
301
|
+
[150, 8211],
|
302
|
+
[151, 8212],
|
303
|
+
[152, 732],
|
304
|
+
[153, 8482],
|
305
|
+
[154, 353],
|
306
|
+
[155, 8250],
|
307
|
+
[156, 339],
|
308
|
+
[158, 382],
|
309
|
+
[159, 376],
|
314
310
|
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
311
|
+
[8194, 'ensp'],
|
312
|
+
[8195, 'emsp'],
|
313
|
+
[8201, 'thinsp'],
|
314
|
+
]
|
319
315
|
|
320
316
|
# Contains the mapping of code point (or name) to the actual Entity object.
|
321
|
-
ENTITY_MAP = Hash.new do |h,k|
|
317
|
+
ENTITY_MAP = Hash.new do |h, k|
|
322
318
|
if k.kind_of?(Integer)
|
323
319
|
h[k] = Entity.new(k, nil)
|
324
320
|
else
|
@@ -346,4 +342,3 @@ module Kramdown
|
|
346
342
|
end
|
347
343
|
|
348
344
|
end
|
349
|
-
|