]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/text.C
* src/frontends/qt4/ui/QPrefCygwinPathUi.ui:
[lyx.git] / src / tex2lyx / text.C
index 8b169b2167ed72817fb63c9f8efd730378fe5e01..2f7740686faf04eea94d3693aee58b084fdeb0f4 100644 (file)
@@ -1055,7 +1055,13 @@ void parse_noweb(Parser & p, ostream & os, Context & context)
                return;
        }
 
-       context.check_end_layout(os);
+       // We use new_paragraph instead of check_end_layout because the stuff
+       // following the noweb chunk needs to start with a \begin_layout.
+       // This may create a new paragraph even if there was none in the
+       // noweb file, but the alternative is an invalid LyX file. Since
+       // noweb code chunks are implemented with a layout style in LyX they
+       // always must be in an own paragraph.
+       context.new_paragraph(os);
        Context newcontext(true, context.textclass, context.textclass["Scrap"]);
        newcontext.check_layout(os);
        os << name;