# multi level lists are flatened in Marked 2

#### mike

11 Apr, 2016 06:21 PM

// Please enter a detailed description of the issue
// Description of the issue:
Marked isn’t maintaining the structure of lists. Take a look at the attached png file. It shows Atom on top with some github markdown and a preview. There are indented list levels that Marked 2, below, doesn’t pick up.

// Please enter a list of steps required to reproduce the issue
// Steps to reproduce:

1. Create multi level lists in Atom using Github Markdown as file type
2. Save file from Atom
3. open file in Marked 2 - lists levels are removed and a flat list is created

// If applicable please attach a sample document that causes the issue for you.

// Configuration (do not edit)
Marked 2 922 (Direct)
OS X Version: 10.11.4
---
allowPageBreakInCode: 1
bookTxtIsLeanpub: 0
codeIsPoetry: 0
convertGithubCheckboxes: 1
convertYAMLToMMD: 0
defaultMathJaxConfig: TeX-AMS-MML_HTMLorMML
defaultPreviewStyle: 3
defaultProcessor: Discount (GFM)
enableMiniMap: 0
excludeBlockQuotesFromCounts: 0
excludeFootnotesFromCounts: 0
excludeVerbatimFromCounts: 0
excludeCaptionsFromCounts: 0
folderPreviewExtensionsArray: md, markdown, txt, mdown, html, opml
githubNewlines: 1
h1IsPageBreak: 0
h2IsPageBreak: 0
hrIsPageBreak: 0
includeMathJax: 1
limitTextWidth: 0
minimalJavaScript: 0
outlineModeExtensions:
permissionGranted: 0
processHTMLFiles: 1
scrollToEdit: 1
shouldDetectCritic: 1
shouldHighlightMarkupErrors: 1
syntaxHighlight: 1

1. Support Staff Posted by Brett on 11 Apr, 2016 06:41 PM

I'm going to assume you're using 2 spaces to indent nested list items. This may cause incompatibility with various processors (though it technically should work fine with most Marked/GFM configurations). If you use 4 spaces or a tab, it will guarantee compatibility across all markdown processors.

-Brett

2. Posted by Mike Woods on 11 Apr, 2016 06:50 PM

I'm using tabs but you're correct. Atom is replacing the tab with 2 spaces. I'll search their settings and/or take it up with them.

Thanks,
mike

3. Posted by Mike Woods on 11 Apr, 2016 08:08 PM

Both of these files display as flat lists in Marked 2. One uses 4 spaces for tabs and the other uses tabs for tabs. I sure could be doing something stupid but it looks like it's back on Marked 2 to me.

Regards,
mike

________________________________________
From: Mike Woods
Sent: Monday, April 11, 2016 11:50 AM
To: Brett
Subject: Re: multi level lists are flatened in Marked 2 [Problems]

I'm using tabs but you're correct. Atom is replacing the tab with 2 spaces. I'll search their settings and/or take it up with them.

Thanks,
mike

4. Support Staff Posted by Brett on 12 Apr, 2016 02:19 PM

You just need a blank line before starting the list.

one:

- two

-Brett

5. Posted by mike on 12 Apr, 2016 09:27 PM

Drats! It _was_ me being stupid. I hate that.

The editors I commonly use for markdown (Coda, Espresso, Atom) all preview lists correctly without the top blank line. I humbly suggest that Marked 2 follow that convention in a future version.

I get that you're most likely focused on comparability with common markdown parser engines and not editors. I understand that my request would be a non-starter in that scenario.

Well thanks for the help! I appreciate your time.

Regards,
mike

6. Posted by robinlandy on 08 Feb, 2021 03:27 PM

Would it be possible to add an option in Marked to format lists as lists (both ordered and unordered) even if there's no blank line before starting the list?

I do all my writing in Ulysses - which doesn't require a blank line, and I'm not keen to start adding blank lines before each list.

7. Support Staff Posted by Brett on 08 Feb, 2021 06:26 PM

This is a function of the Markdown processor (MultiMarkdown 5 or
Discount). As you can see here, it's pretty split as to whether it's
accepted:
https://babelmark.github.io/?text=No+line+break.%0A-+Lorem+ipsum%0A-+Lorem+ipsum

You can always add a custom processor using any of the flavors on that
page that do accept that formatting. If you need help setting something
up, let me know and I can try to guide you.

Of course, the easiest thing to do is to add whitespace regardless of
what Ulysses allows. It generally makes the text more readable anyway...

-Brett

8. Posted by robinlandy on 09 Feb, 2021 02:16 PM

Thanks Brett.

Yes - please could I get some step-by-step on how to do this?

I tried installing Commonmark.js and then enabling it as a custom processor in the settings (I followed the help here: https://marked2app.com/help/Custom_Processor.html )

...but Marked crashes each time I try to export to it from Ulysses.

Thanks

Robin.

9. Support Staff Posted by Brett on 09 Feb, 2021 02:20 PM

Is your Custom Processor working from the command line?

10. Posted by robinlandy on 10 Feb, 2021 12:42 PM

Thanks Brett. With a bit of tinkering, the CommonMark processor is now happily outputting in Marked, and lists render as lists even when not preceded by a blank line.

However, Marked is now no longer rendering line-breaks between paragraphs. I've attached a screenshot, with Ulysses on the right, and the Marked output on the left. The issue occurs with all Marked themes, but resolves itself if I go back to the default Marked processor.

Is there a setting for this somewhere in Marked which I've missed?

11. Support Staff Posted by Brett on 10 Feb, 2021 01:42 PM

This sounds like an issue with the CommonMark processor, then. Maybe a command line option you can change?

Thanks,
Brett

12. Support Staff Posted by Brett on 10 Feb, 2021 01:43 PM

Most processors require a blank line between paragraphs. Ulysses really should be outputting that way.

Thanks,
Brett

13. Posted by robinlandy on 10 Feb, 2021 02:48 PM

Thanks Brett. I am (enjoying) going down a rabbit-hole of Markdown implementation syntax.

Pandocs appears to do what I need - but I have to enable two Pandoc extensions. How do I do that via the Args option in the Marked Advanced preferences?

I tried: -f markdown+hard_line_breaks which works

and -f markdown+lists_without_preceding_blankline which also works.

But when I put both strings into the 'Args' box with a space between them, they don't work. What's the exact string I need to use?

14. Support Staff Posted by Brett on 10 Feb, 2021 03:45 PM

I believe you can only specify one -f flag, so the correct argument
would be:

-f markdown+hard_line_breaks+lists_without_preceding_blankline

-Brett

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

### »

• marked_question.png 1.18 MB

#### Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

# Keyboard shortcuts

### Generic

? Show this help Blurs the current field

### Comment Form

r Focus the comment reply box Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

## Recent Discussions

 28 Mar, 2023 11:31 PM CLI support 28 Mar, 2023 01:56 PM Integration with Hookmark causes Hookmark window to popup 20 Mar, 2023 05:32 PM Preference to inject a block or file of JavaScript for custom syntax highlighting or other processing? 11 Mar, 2023 02:05 PM Text surrounded with backticks may be displayed with elements. 06 Mar, 2023 06:02 PM Files containing Critic Markup fail to be displayed in Marked

## Recent Articles

 Intra-document links in exported PDFs Using Ulysses with Marked Fenced code blocks inside indented code blocks Using JavaScript in Marked Custom CSS: Writing custom CSS for Marked