Repository navigation
Enhancement (config): Add ability for $keepspaces option to strip empty paragraphs - #209
Open
El1as42 wants to merge 1 commit into
Conversation
…mpty paragraphs Pandoc converts each empty paragraph of a page to a paragraph containing only a non-breaking space. `$keepspaces = 1` removed the non-breaking space, but left the paragraph's blank lines, so each empty paragraph became three blank lines between paragraphs. Empty paragraphs are common, since OneNote's Word export also adds one between separate outlines (text boxes) of a page. Now `$keepspaces = 1` also removes empty paragraphs, so paragraphs are separated by a single blank line. This includes empty paragraphs in lists and blockquotes. 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 #206
Pandoc converts each empty paragraph of a page to a paragraph containing only a non-breaking space.
$keepspaces = 1(default) removed the non-breaking space, but not the paragraph's blank lines, so each empty paragraph became three blank lines.Changes
$keepspaces = 1: also remove empty paragraphs, i.e. lines containing only non-breaking spaces, including in lists and quotes. Paragraphs are then separated by a single blank line. Lines containing text are not affected, and$keepspaces = 2still keeps empty paragraphs.config.example.ps1, andREADME.mdmentions empty paragraphs.Since
$keepspaces = 1is the default, this changes the default output. The rendered markdown stays the same, since several blank lines between paragraphs render like one. Only the markdown itself (e.g. in Obsidian's editor) no longer has the extra blank lines.Tests: the
$keepspacestest now includes empty paragraphs between paragraphs, two in a row, in a list, in a quote, and at the end of the page. The existing expectations are unchanged. 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: each empty paragraph now becomes a single blank line.🤖 Generated with Claude Code