reversemarkdown-net
reversemarkdown-net copied to clipboard
Blank lines being added on things that are getting dropped/bypassed
$Splat = @{
#Content = $BlogContent.Content
Path = $FilePath
DestinationPath = "$PSScriptRoot\OutputBlogs\$($FileName).md"
UnknownTags = 'Bypass'
GithubFlavored = $true
RemoveComments = $true
SmartHrefHandling = $true
RulesBefore = $RulesBefore
RulesAfter = $RulesAfter
DefaultCodeBlockLanguage = 'powershell'
}
There's a lot of blank lines that stay after your library goes thru the HTML. It seems that every time some tags are removed those are replaced by blank lines? Could it be those are totally skipped maybe?
I discovered that as well, but ende up cleaning the result with simple postprocessing.
result = result.Replace("\n\n", "\n");
result = result.Replace("\r\n\r\n", "\r\n");
result = result.Replace("\r\n\r\n", "\r\n");
if (result.StartsWith("\r\n"))
{
result = result.TrimStart('\r', '\n');
}
return result;
so maybe we can have something like this by default?
I discovered that as well, but ende up cleaning the result with simple postprocessing.
result = result.Replace("\n\n", "\n"); result = result.Replace("\r\n\r\n", "\r\n"); result = result.Replace("\r\n\r\n", "\r\n"); if (result.StartsWith("\r\n")) { result = result.TrimStart('\r', '\n'); } return result;
so maybe we can have something like this by default?
I have added some cleanup and processing of newlines in 3.21.0, please take latest and check if it has become better. Possibly you don't need to do this step going forward.
seems to be a bit better. need to check more in detail
Closing this, please file a new issue if you see any further issues.