From 3b46d6b7d1944d701dd276d0b19a9645a09649bc Mon Sep 17 00:00:00 2001 From: Nick Groenen Date: Mon, 21 Dec 2020 13:01:08 +0100 Subject: [PATCH] New: Report file tree when RecursionLimitExceeded is hit This refactors the Context to maintain a list of all the files which have been processed so far in a chain of embeds. This information is then used to print a more helpful error message to users of the CLI when RecursionLimitExceeded is returned. --- src/lib.rs | 64 +++++++++++++++++++++++++++----------------- src/main.rs | 32 ++++++++++++++++++++-- tests/export_test.rs | 2 +- 3 files changed, 71 insertions(+), 27 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index ca90ff9..2542dbf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,7 +8,7 @@ pub use walker::{vault_contents, WalkOptions}; use pathdiff::diff_paths; use percent_encoding::{utf8_percent_encode, AsciiSet, CONTROLS}; use pulldown_cmark::{CodeBlockKind, CowStr, Event, Options, Parser, Tag}; -use pulldown_cmark_to_cmark::{self, cmark_with_options}; +use pulldown_cmark_to_cmark::cmark_with_options; use rayon::prelude::*; use regex::Regex; use snafu::{ResultExt, Snafu}; @@ -27,7 +27,7 @@ lazy_static! { Regex::new(r"^(?P[^#|]+)(#(?P.+?))??(\|(?P