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

Issues on Codes blocks generation #617

Closed
neooblaster opened this issue Nov 7, 2018 · 4 comments
Closed

Issues on Codes blocks generation #617

neooblaster opened this issue Nov 7, 2018 · 4 comments
Assignees

Comments

@neooblaster
Copy link

neooblaster commented Nov 7, 2018

Hi team,

I just install Showdown in version 1.8.7 :
image

Currently, I'm facing of an old issue which must be fixed (#184)

The following Markdown code produce this result :

* **Author** : ``Nicolas DUPRE (NDU9005)``
* **Release** : ``01.10.2018``
* **JIRA request** : ``CEPS01T-83283``
* **Edition Tags** : 
    ````abap
    * BEGIN_ADDITION - NDU90045 - CEPS01T-83283
      <<Code Changes Here>>
    */ END_ADDITION - NDU90045 - CEPS01T-83283
    ````

image

It's very weird, because the underscore in BEGIN_ADDITION disapears. I try to break BEGIN_ADDITION which can be an instruction in the Showdown engine, but nothing change.


The following Markdown code produce the good result :

* **Author** : ``Nicolas DUPRE (NDU9005)``
* **Release** : ``01.10.2018``
* **JIRA request** : ``CEPS01T-83283``
* **Edition Tags** : 
````abap
* BEGIN_ADDITION - NDU90045 - CEPS01T-83283
  Code Changes Here
*/ END_ADDITION - NDU90045 - CEPS01T-83283

( Dont take care of code highlight)
image

I expected this result :
image


When I add a new line , that works, but I don't want these spaced lines :

* **Author** : ``Nicolas DUPRE (NDU90045)``
* **Release** : ``01.10.2018``
* **JIRA request** : ``CEPS01T-83283``
* **Edition Tags** : 

    ````abap
    * BEGIN_ADDITION - NDU90045 - CEPS01T-83283
      Code Changes Here
    */ END_ADDITION - NDU90045 - CEPS01T-83283
    ````

image

UPDATE :
When I use Indented code block, , in this following code block, the result is a Code block into another one :

      " Parcourir le niveau 1 de la hiérachie.
      LOOP AT lt_rgsb1.
        CALL FUNCTION 'G_SET_FETCH'
          EXPORTING
            setnr            = lt_rgsb1-setnr
          TABLES
            set_lines_single = lt_rgsb2
          EXCEPTIONS
            no_authority     = 1
            set_is_broken    = 2
            set_not_found    = 3
            OTHERS           = 4.
    
    
        " Parcourir le niveau 2 de la hiérachie.
        LOOP AT lt_rgsb2.
          CALL FUNCTION 'G_SET_FETCH'
            EXPORTING
              setnr            = lt_rgsb2-setnr
            TABLES
              set_lines_single = lt_rgsb3
            EXCEPTIONS
              no_authority     = 1
              set_is_broken    = 2
              set_not_found    = 3
              OTHERS           = 4.

Result :
image
image

With my development experience, one possible explanation could be, when openning tags for code block did not begin at the first char of one line (so, containing spaces/tab (in my case tab are spaces)), the engine only check the closing tag for code block, without take care of spaces/tab as the openning one. So the first corresponding closing tag (```) is good candidate.

When the root openning tag for code don't begin with tab/space, there is no issue.
END UPDATE.

Do you know why that does not work in my case ?

Thanks a lot for the support.

Best Regards,
Nicolas DUPRE

@tivie
Copy link
Member

tivie commented Nov 7, 2018

Hi @neooblaster

The newline between * **Edition Tags** : and the fenced codeblock is required according to the original spec.

Some markdown implementations are more lax and don't require this (namely commonmark)

Note: Showdown version 2.0 which have a fully compliant commonmark "mode".

@tivie tivie self-assigned this Nov 7, 2018
@neooblaster neooblaster changed the title Issue on Code block generation Issues on Codes blocks generation Nov 8, 2018
@neooblaster
Copy link
Author

Hi @tivie,

Thank you for your reply. I did not know that was the official spec.
I always skip the newline, because my tools which renders my Markdown (PhpStorm, Markdown-PDF) add spaces between my list items.

An idea when Showdown v2.0 will be released ?

@tivie
Copy link
Member

tivie commented Nov 10, 2018

Hope I can launch an alpha until the end of the year

@tivie tivie closed this as completed Nov 10, 2018
@neooblaster
Copy link
Author

Ok top !
I will be present to test it with my "issue" ;)

Thank you for your support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants