Allow configuration of typographical replacements, e.g. smart quotes
If you're living in a non-UTF-8 character set, then you can configure what quotes are smartly changed. If my regexes are messing things up, you can also turn this off with smart_quotes: false Also updated docs. This closes #50
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
# If we want to disable smart quoting and only allow explicit quoting within markup,
|
||||
# use this option
|
||||
smart_quotes: false
|
||||
@@ -0,0 +1,15 @@
|
||||
require 'squib'
|
||||
|
||||
Squib::Deck.new(config: 'config_text_markup.yml') do
|
||||
text str: %{"'Yaml ain't markup', he says"},
|
||||
x: 10, y: 10, width: 300, height: 200, font: 'Serif 20',
|
||||
markup: true, hint: :cyan
|
||||
save_png prefix: 'config_text_'
|
||||
end
|
||||
|
||||
Squib::Deck.new(config: 'config_disable_quotes.yml') do
|
||||
text str: %{This has typographic sugar --- and ``explicit'' quotes --- but the quotes are "dumb"},
|
||||
x: 10, y: 10, width: 300, height: 200, font: 'Serif 20',
|
||||
markup: true, hint: :cyan
|
||||
save_png prefix: 'config_disable_text_'
|
||||
end
|
||||
@@ -0,0 +1,8 @@
|
||||
# We can configure what characters actually get replaced by quoting them with unicode code points.
|
||||
lsquote: "\u2018" #note that Yaml wants double quotes here to use escape chars
|
||||
rsquote: "\u2019"
|
||||
ldquote: "\u201C"
|
||||
rdquote: "\u201D"
|
||||
em_dash: "\u2014"
|
||||
en_dash: "\u2013"
|
||||
ellipsis: "\u2026"
|
||||
Reference in New Issue
Block a user