From 78aed77c3d90b6fc72c59c74937ece2e8bc8356d Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sun, 15 Apr 2018 12:31:27 +0200 Subject: [PATCH] needsCProtection: consider LaTeXType "none" --- src/insets/InsetText.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index 4c560f492c..e65f7e9d03 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -1091,8 +1091,9 @@ bool InsetText::needsCProtection() const if (!getLayout().needsCProtect()) return false; - // Environments need cprotection regardless the content - if (getLayout().latextype() == InsetLayout::ENVIRONMENT) + // Environments and "no latex" types (e.g., knitr chunks) + // need cprotection regardless the content + if (getLayout().latextype() != InsetLayout::COMMAND) return true; // Commands need cprotection if they contain specific chars -- 2.39.2