Support specific lines highlighting like Vuepress allow

justrafi's Avatar

justrafi

01 Jan, 2019 10:18 PM

Vuepress is a great static site generator, has many features. One of them is line highlighting:
https://vuepressbook.com/tutorial/tutorial6.html#highlighting-code

This is a great feature, for example, you'd use {5} to specify line 5, {12-17} to specify lines 12
through 17. The example below highlights lines 5 and 6, 12 through 17, and line 19:

```javascript{5-6,12-17,19}

... code ...

```

Unfortunately Marked 2 completely breaks when using this feature in Markdown files.

Could you add this feature? Or at least fix Marked 2 so it won't completely break? :)

Thanks for a great app.

  1. Support Staff 1 Posted by Brett on 01 Jan, 2019 10:36 PM

    Brett's Avatar

    Sorry, line highlighting isn't something that Marked is going to
    support, and the syntax is well outside the range of what could safely
    be expected for a Markdown language identifier. That makes it quite
    complex to work around the errors it causes, but I'll add it to the
    debugging list.

    -Brett

Reply to this discussion

Internal reply

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

Attaching KB article:

»

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
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac