md-2-json icon indicating copy to clipboard operation
md-2-json copied to clipboard

Hashtags in code snippets being interpreted as headings

Open thecodechemist99 opened this issue 4 years ago • 3 comments

I'm using this module for a small tool at work. In a file I tried to process, there was a code snippet with hashtags at the beginning of a line. These are interpreted by md-2-json as headings, regardless of being inside a code block.

thecodechemist99 avatar Dec 11 '20 10:12 thecodechemist99

@thecodechemist99 Can you share the example markdown for this?

ajithr avatar Dec 12 '20 02:12 ajithr

I'ts been something like this (spaces inserted so github doesn't end the block there):

` ` `bash
# Blablabla
# Blablabla
... some code
` ` `

I'm not quite shure but it probably was some shell example code, so there were comments which began with a #. After conversion to JSON these comments in the code were included as headings.

thecodechemist99 avatar Dec 13 '20 20:12 thecodechemist99

@thecodechemist99 Thanks for the code snippets. Unfortunately, I can't reproduce the issue with the provided code snippet. The md-2-json library works based on its headings. Can you share a dummy markdown content with the heading structure? I have tried below, but the reported issue not reproducing.

# Heading1
```bash
# Blablabla
# Blablabla
... some code
```

ajithr avatar Jan 26 '21 13:01 ajithr