* Search and Replace: Angle Brackets

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
avatar
Jean001
Famous
Posts: 104
Joined: 03 Mar 2021 11:49
Family Historian: V7

Search and Replace: Angle Brackets

Post by Jean001 » 20 Jul 2022 13:53

Since upgrading I have noticed a problem with S&R and angle brackets in plain text. I'm fairly sure that I never had it in v6. The 'Current Value' and 'Replacement Value' windows show the correct before and after values, the record itself (e.g. Source) frequently has missing text after the replaced text. Even if the angle bracket is not used as part of the search text, if there is one in the line of text the problem still exists.

I am using S&R v.3.6.

Any help would be greatly appreciated.
Jean

User avatar
tatewise
Megastar
Posts: 27080
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Search and Replace: Angle Brackets

Post by tatewise » 20 Jul 2022 15:21

Sorry Jean, but just saying you have a problem is too vague for me to investigate.
Is it simply that sometimes there is missing text after the replaced text?
Have you any repeatable examples?

In conjunction with Search and Replace Error Message (20816) I wonder if something more subtle is going on.

Have you tried a PC Restart (NOT Shutdown)?
Have you tried reinstalling FH V7?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
Jean001
Famous
Posts: 104
Joined: 03 Mar 2021 11:49
Family Historian: V7

Re: Search and Replace: Angle Brackets

Post by Jean001 » 20 Jul 2022 17:24

Thank you Mike. I have already tried Restart, to no avail.

Both of the Search and Replace problems started as soon as I upgraded, so I put them down to a quirk of the upgrade. I will do a re-install (that'll have to be tomorrow).

Here's a glimpse of the problem:

I am working in a Source Record, Text From Source box. Using Note produces the same results.

Original Text
< TXT Line 1
> TXT Line 2
++++++++++++++++++++++++++
TEXT BELOW HERE
aaaaaaa bbbbbbb ccccccc

==========================
Plain Text Mode
Case Sensitive
Part Words (No change if 'Whole Words' selected)
Show White Space

TEST 1
Search Criteria
·TXT
Replace
TXT
Actual Result
TXT Line 2
++++++++++++++++++++++++++
TEXT BELOW HERE
aaaaaaa bbbbbbb ccccccc

TEST 2
Search Criteria
<·TXT
Replace
TXT
Actual Result
TXT Line 1
TXT Line 2
++++++++++++++++++++++++++
TEXT BELOW HERE
aaaaaaa bbbbbbb ccccccc
Note: TXT Line 2 is very indented. The line looks as if it might begin with a tab but moving the cursor character by character from the end of the line to the beginning indicates a what I presume is a space character before 'TXT' then the cursor moves up a line, not to the 'left margin'.
(I see in Preview here that the 'tab' space before 'TXT' gets removed/ignored on posting.)

TEST 3
Search Criteria
>·TXT
Replace
TXT
Actual Result
The Text from Source Box now has no text.
Jean

User avatar
tatewise
Megastar
Posts: 27080
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Search and Replace: Angle Brackets

Post by tatewise » 20 Jul 2022 18:08

Thank you Jean, that has enabled me to identify the problem.

In your Project, the Text From Source and Note fields are plain text but in FH V7 could be rich text.
However, they include < and > characters that have a special meaning in rich text unless prefixed with \ escape character.

The plugin was treating all such fields as if they were rich text and the replacement process mishandled the < and > chars.

The attached Search and Replace plugin Version 3.6.1 Date 20 Jul 2022 fixes the problem by checking if the field is actually in rich text format or plain text format before performing the replacement.
Last edited by tatewise on 09 May 2023 19:44, edited 1 time in total.
Reason: Attachment deleted as later version is in the Plugin Store.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
Jean001
Famous
Posts: 104
Joined: 03 Mar 2021 11:49
Family Historian: V7

Re: Search and Replace: Angle Brackets

Post by Jean001 » 20 Jul 2022 18:38

Many thanks, Mike.

That's resolved the problem.
Jean

Post Reply