]> git.lyx.org Git - lyx.git/commitdiff
Slight improvement and a comment.
authorRichard Heck <rgheck@comcast.net>
Tue, 13 Jul 2010 21:10:26 +0000 (21:10 +0000)
committerRichard Heck <rgheck@comcast.net>
Tue, 13 Jul 2010 21:10:26 +0000 (21:10 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34892 a592a061-630c-0410-9148-cb99ea01b6c8

lib/lyx2lyx/lyx_2_0.py

index ab0b093a2404474981df3bc283d1be1db4ab6680..a375de916c45acc09e24e780f826a9bc53119ef5 100644 (file)
@@ -40,12 +40,16 @@ def find_end_of_inset(lines, i):
     return find_end_of(lines, i, "\\begin_inset", "\\end_inset")
 
 
+# Note that text can be either a list of lines or a single line.
 def add_to_preamble(document, text):
     """ Add text to the preamble if it is not already there.
     Only the first line is checked!"""
 
     if not type(text) is list:
-      text = [text]
+      # split on \n just in case
+      # it'll give us the one element list we want
+      # if there's no \n, too
+      text = text.split('\n')
 
     if find_token(document.preamble, text[0], 0) != -1:
         return