From e4dd03c8f09f274a817046e2f4f8b83939a2c06d Mon Sep 17 00:00:00 2001 From: Michal Budzynski Date: Thu, 18 May 2017 00:04:09 +0200 Subject: [PATCH] Fix indentation of hidden code blocks Hidden code blocks are no longer indented with one additional space (required for doctests to compile in some cases) Now the behavior is similar to the rustdoc's --- src/theme/book.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/theme/book.js b/src/theme/book.js index 52be9a9d..424bac56 100644 --- a/src/theme/book.js +++ b/src/theme/book.js @@ -146,10 +146,10 @@ $( document ).ready(function() { for(var n = 0; n < lines.length; n++){ if($.trim(lines[n])[0] == hiding_character){ if(first_non_hidden_line){ - lines[n] = "" + "\n" + lines[n].replace(/(\s*)#/, "$1") + ""; + lines[n] = "" + "\n" + lines[n].replace(/(\s*)# ?/, "$1") + ""; } else { - lines[n] = "" + lines[n].replace(/(\s*)#/, "$1") + "\n" + ""; + lines[n] = "" + lines[n].replace(/(\s*)# ?/, "$1") + "\n" + ""; } lines_hidden = true; }