Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use RegEx in Find/Replace (particularly to add space after paragraph breaks?" #1322

Open
Foxxsayy opened this issue Mar 7, 2024 · 6 comments
Assignees
Labels
answered question Further information is requested

Comments

@Foxxsayy
Copy link

Foxxsayy commented Mar 7, 2024

MAy I ask how to get another line in after a paragraph break? A lot of my web material comes without spacing, and I can't seem to get Find/Replace to work with this. I believe the hidden characters are usually CR and LF, and it seems \n inserts a new line, but I can't get figure out how to get it to replace or insert after paragraph breaks.

@stevencohn
Copy link
Owner

There are a couple of ways to do this. Pressing Enter will obviously create a new paragraph and create the default amount of space between the paragraphs. Pressing Shift-Enter will keep context within the same paragraph but simply insert a line break, similar to a \n.

A second option is to select one or more paragraphs and use the built-in OneNote Paragraph Spacing Option command located in the Alignment drop-down button.

@stevencohn stevencohn added question Further information is requested answered labels Mar 7, 2024
@stevencohn stevencohn self-assigned this Mar 7, 2024
@Foxxsayy
Copy link
Author

Foxxsayy commented Apr 4, 2024

There are a couple of ways to do this. Pressing Enter will obviously create a new paragraph and create the default amount of space between the paragraphs. Pressing Shift-Enter will keep context within the same paragraph but simply insert a line break, similar to a \n.

Thanks Steven. It doesn't seem to be able to find the new lines at all. This is the dialogue I should use, right?

image

@stevencohn
Copy link
Owner

That should work if your page has lines separated by soft breaks created with Shift+Enter. It will not find hard line breaks created with just Enter.

For hard breaks, you'd need to select lines of text and then use the OneMore Edit/Join Paragraph command.

@Foxxsayy
Copy link
Author

For hard breaks, you'd need to select lines of text and then use the OneMore Edit/Join Paragraph command.

Perhaps that's it. I can find the join paragraph, but I can't seem to figure out where edit paragraph is?

image

@ykurji
Copy link

ykurji commented May 17, 2024

did you find a solution to this? I am also trying to figure out how to remove line breaks from selected text

@stevencohn
Copy link
Owner

stevencohn commented May 18, 2024

OneNote does not use CR, LF, or \n as line breaks. Internally, it's a binary format but through the API that OneMore uses, it's XML. As I mentioned above, however, there can be hard breaks and soft breaks. Hard breaks, created when you press Enter, are ostensibly paragraphs. If this is what you have, then you can use the OneMore Join Paragraph command, available on the OneMore Edit menu; this is exactly what you found in your picture above.

Soft breaks, created when you press Shift-Enter are mid-paragraph line breaks. The OneMore Search and Replace dialog, as shown below, knows how to translate \n to these XML soft breaks and can eliminate them, effectively joining the broken lines.

If neither of these solutions work for you, then you may have another use case that I don't understand. So please add more details or an example if you can.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants