From 524a27dd087dd99d81874fb18bacda6ebe8c0e53 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 11 Jan 2020 18:02:24 +1000 Subject: [PATCH] ignore extra { chars in replacement This will still show a trailing } with {{{field}}}, but will at least show the field content instead of 'unknown field'. --- rslib/src/template.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rslib/src/template.rs b/rslib/src/template.rs index 71b086b16..bfee3723a 100644 --- a/rslib/src/template.rs +++ b/rslib/src/template.rs @@ -67,7 +67,7 @@ fn handle_token(s: &str) -> nom::IResult<&str, Token> { /// classify handle based on leading character fn classify_handle(s: &str) -> Token { - let start = s.trim(); + let start = s.trim_start_matches('{').trim(); if start.len() < 2 { return Token::Replacement(start); }