[Libreoffice-bugs] [Bug 43107] Regular expression "\n" in replace field inputs "\n" instead of paragraph break

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Sep 7 16:25:04 UTC 2018


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

DN <documentfoundation at nuclearsunshine.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #20 from DN <documentfoundation at nuclearsunshine.com> ---
> Help reads: : "\n is for line end entered with Shft+Enter"

(for anyone else reading - the help page by clicking Help on the search/replace
window and clicking "List of Regular Expressions")

This is a documentation bug. This refers to Writer only, not Calc.

In *Writer*, <Enter> creates a "Paragraph break", whereas <Shift><Enter>
creates a "line break". Search/replace works as per the "List of Regular
Expressions" docs in Writer, specifically:

> \n
> Represents a line break that was inserted with the Shift+Enter key combination. To change a line break into a paragraph break, enter \n in the Find and Replace boxes, and then perform a search and replace.
> \n in the Find text box stands for a line break that was inserted with the Shift+Enter key combination.
> \n in the Replace text box stands for a paragraph break that can be entered with the Enter or Return key.



> Hence I do not have a file to test this exactly..

The steps I listed result in a doc to test this.



> behavior was the same in version 3.3.0 and is in OpenOffice.
> So, is this really a bug, or something that behaves different than expected??

It's a bug. The content of "replace" should be interpreted as a regex (i.e. \n
should be interpreted as a newline, not a literal string). It may well have
always been a bug in Open/LibreOffice.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20180907/ef7bfee5/attachment.html>


More information about the Libreoffice-bugs mailing list