asciidoctor / kramdown-asciidoc

A kramdown extension for converting Markdown documents to AsciiDoc.
Other
207 stars 19 forks source link

issues with code in citates, created with indent #96

Closed aisbergde closed 2 years ago

aisbergde commented 3 years ago

I get some issues with code in citates created by indent, for example:

issue on date in code

>  For example to cast a date string "08-12-2012" that’s in UK format:
> 
>     PS C:\> [DateTime]::ParseExact("08-12-2012","dd-MM-yyyy",[System.Globalization.CultureInfo]::InvariantCulture) 
>     Saturday, December 08, 2012 00:00:00
> 
> Cast a date string "09-Jun-2012" that’s in UK format and then display it as "yyyy-MM-dd"
> 
>     PS C:\> [DateTime]::ParseExact("09-Jun-2012","dd-MMM-yyyy",[System.Globalization.CultureInfo]::InvariantCulture).ToString("yyyy-MM-dd")
>     2012-06-09

issue on converting code in citate

>  If you are going to cast a variable into a new datatype it is a good idea to first test if the value will cast sucessfully using -as, if the conversion fails, it will return a NULL, which can be used to either avoid the conversion or to raise an error:
> 
>     [string]$var = "64a"
>     if( ($var -as [double]) -ne $null ) {
>        [double]$var = $var
>     }
>     $var.GetType().FullName
mojavelinux commented 2 years ago

The issue here is that the blockquote ends with a nested block and the converter is not accounting for that data type. Here's a minimal example:

> paragraph text
>
>     code block

I will apply a fix.