The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 3d2dcab03f4df849ee12d81fa3abc9e993d8c8c6
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Tue Feb 12 18:36:25 2013 +0100

    Handle properly insets which have the PassThru property
    
    This fixes in particular bug 5312:
      % escape in \url{} treated as TeX comment start by importer

diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index f9888df..855ac28 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -1698,7 +1698,14 @@ void parse_environment(Parser & p, ostream & os, bool 
outer,
                begin_inset(os, "Flex ");
                os << to_utf8(newinsetlayout->name()) << '\n'
                   << "status collapsed\n";
-               parse_text_in_inset(p, os, FLAG_END, false, parent_context, 
newinsetlayout);
+               if (newinsetlayout->isPassThru()) {
+                       string const arg = p.verbatimEnvironment(name);
+                       Context context(true, parent_context.textclass, 
+                                       &parent_context.textclass.plainLayout(),
+                                       parent_context.layout);
+                       output_ert(os, arg, parent_context);
+               } else
+                       parse_text_in_inset(p, os, FLAG_END, false, 
parent_context, newinsetlayout);
                end_inset(os);
        }
 
@@ -4476,7 +4483,20 @@ void parse_text(Parser & p, ostream & os, unsigned 
flags, bool outer,
                        begin_inset(os, "Flex ");
                        os << to_utf8(newinsetlayout->name()) << '\n'
                           << "status collapsed\n";
-                       parse_text_in_inset(p, os, FLAG_ITEM, false, context, 
newinsetlayout);
+                       if (newinsetlayout->isPassThru()) {
+                               // set catcodes to verbatim early, just in case.
+                               p.setCatcodes(VERBATIM_CATCODES);
+                               string delim = p.get_token().asInput();
+                               if (delim != "{")
+                                       cerr << "Warning: bad delimiter for 
command " << t.asInput() << endl;
+                               string const arg = p.verbatimStuff("}");
+                               Context newcontext(true, context.textclass);
+                               if (newinsetlayout->forcePlainLayout())
+                                       newcontext.layout = 
&context.textclass.plainLayout();
+                               output_ert(os, arg, newcontext);
+                       } else
+                               
+                               parse_text_in_inset(p, os, FLAG_ITEM, false, 
context, newinsetlayout);
                        end_inset(os);
                }
 

-----------------------------------------------------------------------

Summary of changes:
 src/tex2lyx/text.cpp |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to