https://bugs.documentfoundation.org/show_bug.cgi?id=138489

            Bug ID: 138489
           Summary: Search and replace with regex $1 deletes existing
                    emphasis or italics Editing, Search Replace, Regular
                    expressions
           Product: LibreOffice
           Version: 6.4.6.2 release
          Hardware: All
                OS: Mac OS X (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: [email protected]
          Reporter: [email protected]

Description:
When using a search and replace string such as this one:
(\s+)([—|–]|\-{1,})(\s*)(.*?)(\s*)([—|–]|\-{1,})
and replace the results with
–⁠$4⁠–
any emphasis or italics (ith happens both when italics/emphasis is the only
formatting and when it is just a word which is in italics/emphasis) is gone and
one finds a text in with the regular format instead.

Steps to Reproduce:
1. Create or upload the attached document with - word italicsword word -.
2. Use Regex (\s+)([—|–]|\-{1,})(\s*)(.*?)(\s*)([—|–]|\-{1,}) to find the
instance.
3. Replace with –⁠$4⁠–

Actual Results:
Italics/emphasis is gone

Expected Results:
Italics and emphasis should remain since I do not want to change them.


Reproducible: Always


User Profile Reset: No



Additional Info:
If it is not a bug and meant to be working like this, maybe a "keep format"
option could be added to the search and replace window since the change which
occurs is not desired by the user. It does happen with other search and replace
strings (quotes for example) (\s+)([—|“]|\-{1,})(\s*)(.*?)(\s*)([—|”]|\-{1,})

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to