On 01/25/2011 08:45 PM, Cyrille Artho wrote:
I have looked into this glitch, and it seems to be an issue of the GUI doing exactly what the user does, which is not always what the user wants. In particular, it comes from the fact that one may not always select parts of a text with exact consistency (regarding whitespace).

This issue does not happen when one double-clicks on a word to be emphasized, or selects it consistently (always up to the word boundary, without its surrounding space).

However, the following actions reproduce it:

(0) Create a new document.

(1) Enter "This is not pretty".

(2) Select " not " including spaces.

(3) Select "emphasize"; the LaTeX source is updated to

    This is\emph{ not }pretty.

IMO this is already wrong here, as the \emph markup should be trimmed not to include leading or trailing white space (although other non-alphanumeric characters such as punctuation must be included).

(4) Double-click "not", selecting just the word (w/o spaces).
    Select "emphasize" again, and the code becomes even worse:

    This is\emph{ }not\emph{ }pretty.

I think the issue should be fixed at step (3), not at step (4) or as post-processing. What do you think? Should I file a bug report to make the issue more easily trackable?

I agree with you. Please do file a bug report and cc me (rgheck).

Richard

Reply via email to