Fix issue #1600, allow \\ to escape a backslash in replacement string - #1603
Fix issue #1600, allow \\ to escape a backslash in replacement string#1603mrducky4 wants to merge 1 commit into
Conversation
…h in replacement string
|
Related to this code change, I propose updating the Help page. Where it says "To replace matched text with a new line, \n may be used in the replace field." add this: |
|
Just an observation, I'm not saying this should influence how escaping characters in the PI should work. In Guiguts 2 search, if I search for |
@windymilla, can you please give us your thoughts on how you think we should address this search/replace issue in the current proofreading interface? See also the discussion in #1600 |
|
tl;dr - remove Looking at the comments from users, it appears people previously assumed the Perhaps the history is that there was no regex option originally, so the Possible options seem to be:
My order of preference would be 2, 1, 3, but bear in mind that I've never used the feature. If I had something complicated to format with substitutions (regex/normal) I'd probably just copy the text into another editor, fix it there, then copy it back into the PI. |
|
I am happy to change this PR to do windymilla's option 2, if cpeel agrees with that. Please let me know. I think the |
I'm fine with this. Having it map to other DP tools makes sense.
Probably. |
I'm not entirely sure why |
|
Late comment, probably for future consideration. There are other common escaped characters -- Edit: actually, |
For search/replace in the proofing interface, allow
\\to escape\in the replacement string.Previously, any occurence of
\nin the replacement string would become a newline. So\\nwould become a backslash followed by newline. With this change,\\means an escaped backslash, so\\nbecomes a backslash followed by n. Also, any occurence of a single backslash followed by any character other than n just means that character. So to use a literal backslash in the replacement string, always escape it as\\.Sandbox: https://www.pgdp.org/~mrducky/c.branch/replace_newline/