Repository navigation
Enhancement (config): Add option $paragraphSeparator to separate paragraphs with a newline instead of a blank line - #211
Open
Open
Conversation
…ragraphs with a newline instead of a blank line In OneNote, the paragraphs of an outline are on consecutive lines, but pandoc separates each paragraph with a blank line. So a page's lines are spread apart in the markdown, and paragraphs that follow each other cannot be told apart from paragraphs separated by an empty paragraph. The new option `$paragraphSeparator = 2` separates paragraphs with a newline instead, which markdown viewers like Obsidian show as a line break. Paragraphs separated by an empty paragraph, as well as lists, tables, headings, and quotes, are still separated by a blank line. Lines that would turn the previous line into a heading (e.g. `===`) are also still separated by a blank line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #208
In OneNote, the paragraphs of a page are on consecutive lines, but pandoc separates each paragraph with a blank line. So the lines of a page are spread apart in the markdown.
Changes
$paragraphSeparator:1separates paragraphs with a blank line (default, existing behavior),2with a newline, like in OneNote. E.g.foo\n\nbarbecomesfoo\nbar.===) also keep their blank line.README.mdandconfig.example.ps1document the option.Markdown viewers like Obsidian show a newline as a line break (unless its "Strict line breaks" setting is on), while others like GitHub join such lines into one paragraph. This is why it is an option, and noted in its description.
Note: with
$keepspaces = 1, an empty paragraph currently becomes three blank lines. #209 changes this to a single blank line, which this option builds on, but the two PRs do not depend on each other.Tests: a
New-SectionGroupConversionConfigtest for both values, with paragraphs, an empty paragraph, an image, a heading, a list, a table, a quote, and===. Unit tests pass on Windows PowerShell 5.1 and PowerShell 7.0. In this repo's CI (run on my fork), all jobs that can currently run pass: Windows PowerShell 5.1 (windows-2022) and PowerShell 7.1 to 7.4. The other jobs currently fail for any PR, before checkout: thewindows-2019runner image was retired, and the PowerShell 6.0 to 7.0 container images are too old foractions/checkout(GLIBC_2.28' not found). Also tested on real notebook pages: lines that follow each other in OneNote follow each other in the markdown, and empty paragraphs become blank lines.🤖 Generated with Claude Code