Source Line Numbers

Lennart Kiil's Avatar

Lennart Kiil

01 Mar, 2021 09:17 AM

Simply the ability to show the corresponding line numbers from the source .md document in the output shown in marked preview - that way it is easy to find the corresponding location when proofreading in marked and doing the corrections in the source file etc.

  1. Support Staff 1 Posted by Brett on 01 Mar, 2021 01:56 PM

    Brett's Avatar

    Hi Lennart, thanks for the suggestion.

    This is something I've considered before, and I can see its usefulness,
    but it hasn't seemed feasible.

    Long explanation:

    Line numbers in the input don't directly correlate with line numbers in
    the output. Whitespace alone causes differences. Because Marked isn't
    responsible for the actual Markdown->HTML conversion (it uses either
    MultiMarkdown or Discount, depending on settings), the only way to
    associate input lines with output lines would be to add markup to the
    raw text (invisible span tags with the source line number) that would
    then be included in that line's output. This would be ugly to start
    with, and would require a lot of special handling because it would break
    things like hard line breaks, tables, code blocks, etc..

    There are other considerations as well, but that's the primary one
    that's kept me from attempting this.


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


? 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