mirror of
https://github.com/getzola/zola
synced 2024-11-10 06:14:19 +00:00
Fix incorrect default for highlight_code of Config
This commit is contained in:
parent
69a9a352a0
commit
f100d956c6
3 changed files with 9 additions and 4 deletions
|
@ -14,6 +14,8 @@
|
|||
- Add more Emacs temp file to the ignored patterns in `gutenberg serve`
|
||||
- Files starting with `.` are not considered pages anymore even if they end with `.md`
|
||||
- `_processed_images` folder for image processing has been renamed `processed_images` to avoid issues with GitHub Pages
|
||||
- Syntax highlighting default was mistakenly `true`, it has been set to `false`
|
||||
|
||||
|
||||
## 0.4.2 (2018-09-03)
|
||||
|
||||
|
|
|
@ -241,7 +241,7 @@ impl Default for Config {
|
|||
title: None,
|
||||
description: None,
|
||||
theme: None,
|
||||
highlight_code: true,
|
||||
highlight_code: false,
|
||||
highlight_theme: "base16-ocean-dark".to_string(),
|
||||
default_language: "en".to_string(),
|
||||
generate_rss: false,
|
||||
|
|
|
@ -43,7 +43,8 @@ fn doesnt_highlight_code_block_with_highlighting_off() {
|
|||
fn can_highlight_code_block_no_lang() {
|
||||
let tera_ctx = Tera::default();
|
||||
let permalinks_ctx = HashMap::new();
|
||||
let config = Config::default();
|
||||
let mut config = Config::default();
|
||||
config.highlight_code = true;
|
||||
let context = RenderContext::new(&tera_ctx, &config, "", &permalinks_ctx, Path::new("something"), InsertAnchor::None);
|
||||
let res = render_content("```\n$ gutenberg server\n$ ping\n```", &context).unwrap();
|
||||
assert_eq!(
|
||||
|
@ -56,7 +57,8 @@ fn can_highlight_code_block_no_lang() {
|
|||
fn can_highlight_code_block_with_lang() {
|
||||
let tera_ctx = Tera::default();
|
||||
let permalinks_ctx = HashMap::new();
|
||||
let config = Config::default();
|
||||
let mut config = Config::default();
|
||||
config.highlight_code = true;
|
||||
let context = RenderContext::new(&tera_ctx, &config, "", &permalinks_ctx, Path::new("something"), InsertAnchor::None);
|
||||
let res = render_content("```python\nlist.append(1)\n```", &context).unwrap();
|
||||
assert_eq!(
|
||||
|
@ -69,7 +71,8 @@ fn can_highlight_code_block_with_lang() {
|
|||
fn can_higlight_code_block_with_unknown_lang() {
|
||||
let tera_ctx = Tera::default();
|
||||
let permalinks_ctx = HashMap::new();
|
||||
let config = Config::default();
|
||||
let mut config = Config::default();
|
||||
config.highlight_code = true;
|
||||
let context = RenderContext::new(&tera_ctx, &config, "", &permalinks_ctx, Path::new("something"), InsertAnchor::None);
|
||||
let res = render_content("```yolo\nlist.append(1)\n```", &context).unwrap();
|
||||
// defaults to plain text
|
||||
|
|
Loading…
Reference in a new issue