]> git.lyx.org Git - features.git/commit
Make tex2lyx tests green again
authorGeorg Baum <baum@lyx.org>
Thu, 11 Jun 2015 20:25:00 +0000 (22:25 +0200)
committerGeorg Baum <baum@lyx.org>
Thu, 11 Jun 2015 20:25:00 +0000 (22:25 +0200)
commit6f84ceb821782c74281a8822f10d6e82cec07bac
tree447333b784065d513a7925af366ea1944a39f2ce
parent0cd7d1f699026740d75808357babbc01b121c564
Make tex2lyx tests green again

Unfortunately I overlooked in 44f73b065004 that the first three whitespace
changes in box-color-size-space-align.lyx.lyx were actually correct, so they
should not have been reverted. In detail:
1), 2): The space after \raggedleft must not be part of the ERT inset, but it
        is ouput by check_space() as part of the standard text which follows.
3):     The space in front of www is caused by the fact that there is a
        newline between the opening brace of the parbox and the \centering
        command, so this space is not the one after \centering (which is
        correctly swallowed). This additional space is in fact not needed,
        and the contents would look better in LyX without it, but since it is
        not caused by special code I'll put it back in the refernce for now.
        We can still improve this in the future if anybody has a good idea.

The remaining whitespace issues are all fixed by a simple change in
parse_text(): Instead of always eating whitespace after detecting \centering
et al, and always output a space as part of the ERT if these commands need an
ERT, let the standard space handling mechanism kick in: skip whitespace if
no ERT is used (in this case LyX will always output the needed space), and
do not touch whitespace if an ERT is used.
src/tex2lyx/test/box-color-size-space-align.lyx.lyx
src/tex2lyx/text.cpp