0 Replies Latest reply on Jul 13, 2015 10:04 AM by rjohnson_GHM

    Find/Change intended to replace nonprinting spaces unexpectedly deletes other characters


      This Find/Change:

      Find:Change dialog.png

      works as expected UNLESS it encounters a nonbreaking space in a Note followed by a nonbreaking space (immediately outside the Note) — in which case it deletes the character following the second nonbreaking space.

      For example, this shows the text before running the routine:


      In this case I typed "This is a test." twice. Then inserted two nonbreaking spaces between "a" and "test". Then in the first instance I selected the first nonbreaking space and converted it to a Note.

      Then I ran the Find/Change.

      This is the result:


      The routine properly changed both nonbreaking spaces to spaces in the second sentence.

      But in the first sentence (with the Note) it converted both nonbreaking spaces to spaces but also added an extra space (hard to see immediately next to the Note symbol) and deleted the "t" in "test".

      This is repeatable with any text as far as I can tell.

      IMPORTANT NOTE: This only seems to happen if you select "Change All" in the dialog. If you instead choose Change/Find and step through it doesn't delete anything.

      I would like to understand why this is happening and also how to construct a Find/Change for nonbreaking spaces that will work as expected. This routine will ultimately be part of a javascript in a production environment.