From: Richard Heck Date: Tue, 13 Jul 2010 21:10:26 +0000 (+0000) Subject: Slight improvement and a comment. X-Git-Tag: 2.0.0~2987 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=af93776127eb3b7a8dd568215121508fcf571d7f;p=features.git Slight improvement and a comment. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34892 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/lyx2lyx/lyx_2_0.py b/lib/lyx2lyx/lyx_2_0.py index ab0b093a24..a375de916c 100644 --- a/lib/lyx2lyx/lyx_2_0.py +++ b/lib/lyx2lyx/lyx_2_0.py @@ -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