lib/kramdown/options.rb in kramdown-1.15.0 vs lib/kramdown/options.rb in kramdown-1.16.0
- old
+ new
@@ -471,10 +471,41 @@
val = simple_array_validator(val, :smart_quotes, 4)
val.map! {|v| Integer(v) rescue v}
val
end
+ define(:typographic_symbols, Object, {}, <<EOF) do |val|
+Defines a mapping from typographical symbol to output characters
+
+Typographical symbols are normally output using their equivalent Unicode
+codepoint. However, sometimes one wants to change the output, mostly to
+fallback to a sequence of ASCII characters.
+
+This option allows this by specifying a mapping from typographical
+symbol to its output string. For example, the mapping {hellip: ...} would
+output the standard ASCII representation of an ellipsis.
+
+The available typographical symbol names are:
+
+* hellip: ellipsis
+* mdash: em-dash
+* ndash: en-dash
+* laquo: left guillemet
+* raquo: right guillemet
+* laquo_space: left guillemet followed by a space
+* raquo_space: right guillemet preceeded by a space
+
+Default: {}
+Used by: HTML/Latex converter
+EOF
+ val = simple_hash_validator(val, :typographic_symbols)
+ val.keys.each do |k|
+ val[k.kind_of?(String) ? str_to_sym(k) : k] = val.delete(k).to_s
+ end
+ val
+ end
+
define(:remove_block_html_tags, Boolean, true, <<EOF)
Remove block HTML tags
If this option is `true`, the RemoveHtmlTags converter removes
block HTML tags.
@@ -591,10 +622,26 @@
Default: '&8617;'
Used by: HTML converter
EOF
+ define(:footnote_backlink_inline, Boolean, false, <<EOF)
+Specifies whether the footnote backlink should always be inline
+
+With the default of false the footnote backlink is placed at the end of
+the last paragraph if there is one, or an extra paragraph with only the
+footnote backlink is created.
+
+Setting this option to true tries to place the footnote backlink in the
+last, possibly nested paragraph or header. If this fails (e.g. in the
+case of a table), an extra paragraph with only the footnote backlink is
+created.
+
+Default: false
+Used by: HTML converter
+EOF
+
define(:gfm_quirks, Object, [:paragraph_end], <<EOF) do |val|
Enables a set of GFM specific quirks
The way how GFM is transformed on Github often differs from the way
kramdown does things. Many of these differences are negligible but
@@ -611,9 +658,16 @@
Disables the kramdown restriction that at least one blank line has to
be used after a paragraph before a new block element can be started.
Note that if this quirk is used, lazy line wrapping does not fully
work anymore!
+
+* no_auto_typographic
+
+ Disables automatic conversion of some characters into their
+ corresponding typographic symbols (like `--` to em-dash etc).
+ This helps to achieve results closer to what GitHub Flavored
+ Markdown produces.
Default: paragraph_end
Used by: GFM parser
EOF
val = simple_array_validator(val, :gfm_quirks)