garrettm30 Posted March 24, 2020 Posted March 24, 2020 Before I give the recipe, I need explain that in the regex below, I am using \n to stand in for a line break, but unfortunately, \n does not match line breaks in Affinity, but carriage returns. The only way I know to search for a line break in Publisher is with the dropdown, and consequently I can't give you a regex pattern that you can copy from the forum. (That \n is treated as a duplicate of \r is a frequent annoyance to me, and it breaks compatibility with other regex, but that is a tangent to this issue.) Do a regex search for this (but note the above):(\s)?\n(\s)? Now select the same search from the list of recent searches. Result: the first part of the pattern is now dropped: Quote
walt.farrell Posted March 24, 2020 Posted March 24, 2020 Seems like it might be Mac-specific, as I don't get that truncation on Windows. garrettm30 1 Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 18.2.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1
Old Bruce Posted March 24, 2020 Posted March 24, 2020 I find that Publisher uses a Unicode 2029 (Paragraph Separator) instead of a carriage return, Unicode 000D or newline (I think) 000A. This is on Mac. The image is from text copied in Publisher and pasted into BBEdit. Quote Mac Pro (Late 2013) Mac OS 12.7.6 Affinity Designer 2.5.7 | Affinity Photo 2.5.7 | Affinity Publisher 2.5.7 | Beta versions as they appear. I have never mastered color management, period, so I cannot help with that.
garrettm30 Posted March 24, 2020 Author Posted March 24, 2020 That's interesting. If that's the case, my opinion on this is that Serif should still make \n work for newlines, even if they have to first swap out the \n in the search string for whatever character they actually use before passing the string on to whatever regex processing they do. ETC 1 Quote
walt.farrell Posted March 24, 2020 Posted March 24, 2020 1 hour ago, garrettm30 said: If that's the case, my opinion on this is that Serif should still make \n work for newlines, But \n matches paragraph breaks today. If they made it match a line-break then they'd need something else to match the paragraph breaks. And since paragraphs are the usual use for enter/return, it's more appropriate that \n match them than the relatively infrequent line-break, in my opinion. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 18.2.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1
garrettm30 Posted March 24, 2020 Author Posted March 24, 2020 15 minutes ago, walt.farrell said: But \n matches paragraph breaks today. If they made it match a line-break then they'd need something else to match the paragraph breaks. That "something else" already exists: \r, which already matches paragraph breaks in Affinity as it should and as it does as elsewhere. For what it is worth, the distinction between \n and \r is understood by InDesign. Not that I want to hold up InDesign as the master reference that Serif must adhere to if it is going to be successful, but it is to say that a lot of users are going to be accustomed to such usage. But InDesign is not the only software where this works. I am accustomed to it in my own web programming, and notice the quick reference in my favorite regex tool (regex101.com): walt.farrell and ETC 2 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.