Skip to content

Commit b51d3e5

Browse files
authored
Merge pull request #2788 from ehuss/remove-curly-quotes
Remove curly-quotes
2 parents 79e9ae4 + 9ac0eb2 commit b51d3e5

File tree

4 files changed

+3
-55
lines changed

4 files changed

+3
-55
lines changed

crates/mdbook-core/src/config.rs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,6 @@ pub struct HtmlConfig {
424424
pub preferred_dark_theme: Option<String>,
425425
/// Supports smart quotes, apostrophes, ellipsis, en-dash, and em-dash.
426426
pub smart_punctuation: bool,
427-
/// Deprecated alias for `smart_punctuation`.
428-
pub curly_quotes: bool,
429427
/// Should mathjax be enabled?
430428
pub mathjax_support: bool,
431429
/// Whether to fonts.css and respective font files to the output directory.
@@ -490,7 +488,6 @@ impl Default for HtmlConfig {
490488
default_theme: None,
491489
preferred_dark_theme: None,
492490
smart_punctuation: false,
493-
curly_quotes: false,
494491
mathjax_support: false,
495492
copy_fonts: true,
496493
additional_css: Vec::new(),
@@ -523,11 +520,6 @@ impl HtmlConfig {
523520
None => root.join("theme"),
524521
}
525522
}
526-
527-
/// Returns `true` if smart punctuation is enabled.
528-
pub fn smart_punctuation(&self) -> bool {
529-
self.smart_punctuation || self.curly_quotes
530-
}
531523
}
532524

533525
/// Configuration for how to render the print icon, print.html, and print.css.
@@ -1117,37 +1109,4 @@ mod tests {
11171109
assert!(html_config.print.enable);
11181110
assert!(!html_config.print.page_break);
11191111
}
1120-
1121-
#[test]
1122-
fn curly_quotes_or_smart_punctuation() {
1123-
let src = r#"
1124-
[book]
1125-
title = "mdBook Documentation"
1126-
1127-
[output.html]
1128-
smart-punctuation = true
1129-
"#;
1130-
let config = Config::from_str(src).unwrap();
1131-
assert_eq!(config.html_config().unwrap().smart_punctuation(), true);
1132-
1133-
let src = r#"
1134-
[book]
1135-
title = "mdBook Documentation"
1136-
1137-
[output.html]
1138-
curly-quotes = true
1139-
"#;
1140-
let config = Config::from_str(src).unwrap();
1141-
assert_eq!(config.html_config().unwrap().smart_punctuation(), true);
1142-
1143-
let src = r#"
1144-
[book]
1145-
title = "mdBook Documentation"
1146-
"#;
1147-
let config = Config::from_str(src).unwrap();
1148-
assert_eq!(
1149-
config.html_config().unwrap_or_default().smart_punctuation(),
1150-
false
1151-
);
1152-
}
11531112
}

crates/mdbook-driver/src/mdbook.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,6 @@ impl MDBook {
6363

6464
config.update_from_env();
6565

66-
if let Some(html_config) = config.html_config() {
67-
if html_config.curly_quotes {
68-
warn!(
69-
"The output.html.curly-quotes field has been renamed to \
70-
output.html.smart-punctuation.\n\
71-
Use the new name in book.toml to remove this warning."
72-
);
73-
}
74-
}
75-
7666
if log_enabled!(log::Level::Trace) {
7767
for line in format!("Config: {config:#?}").lines() {
7868
trace!("{}", line);

crates/mdbook-html/src/html_handlebars/hbs_renderer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ impl HtmlHandlebars {
5757
.insert("git_repository_edit_url".to_owned(), json!(edit_url));
5858
}
5959

60-
let content = render_markdown(&ch.content, ctx.html_config.smart_punctuation());
60+
let content = render_markdown(&ch.content, ctx.html_config.smart_punctuation);
6161

6262
let fixed_content =
63-
render_markdown_with_path(&ch.content, ctx.html_config.smart_punctuation(), Some(path));
63+
render_markdown_with_path(&ch.content, ctx.html_config.smart_punctuation, Some(path));
6464
if !ctx.is_index && ctx.html_config.print.page_break {
6565
// Add page break between chapters
6666
// See https://developer.mozilla.org/en-US/docs/Web/CSS/break-before and https://developer.mozilla.org/en-US/docs/Web/CSS/page-break-before
@@ -175,7 +175,7 @@ impl HtmlHandlebars {
175175
.to_string()
176176
}
177177
};
178-
let html_content_404 = render_markdown(&content_404, html_config.smart_punctuation());
178+
let html_content_404 = render_markdown(&content_404, html_config.smart_punctuation);
179179

180180
let mut data_404 = data.clone();
181181
let base_url = if let Some(site_url) = &html_config.site_url {

guide/src/format/configuration/renderers.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ The following configuration options are available:
125125
- **smart-punctuation:** Converts quotes to curly quotes, `...` to ``, `--` to en-dash, and `---` to em-dash.
126126
See [Smart Punctuation](../markdown.md#smart-punctuation).
127127
Defaults to `false`.
128-
- **curly-quotes:** Deprecated alias for `smart-punctuation`.
129128
- **mathjax-support:** Adds support for [MathJax](../mathjax.md). Defaults to
130129
`false`.
131130
- **copy-fonts:** (**Deprecated**) If `true` (the default), mdBook uses its built-in fonts which are copied to the output directory.

0 commit comments

Comments
 (0)