Preview does not work if first character is a number

jason.verly's Avatar

jason.verly

20 Feb, 2013 07:14 PM

I've run into a unique situation where Marked is not previewing correctly. Using the following MMD text in Byword:

Title: TEMPX - Test post for Marked Preview

9:42am - Email from

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer enim lectus, dictum ut ultricies in, placerat non orci. Proin eu lorem vehicula erat sollicitudin suscipit vel et nulla. Mauris ut risus urna, id consectetur arcu. Nam ac tempus eros. Nulla velit arcu, lacinia a cursus vel, iaculis non felis. Phasellus hendrerit rhoncus mauris at elementum. Proin sollicitudin dolor vel purus sodales elementum. Pellentesque sed urna nisi. Etiam accumsan ligula augue.

Marked is only showing the 'Lorem ipsum...' paragraph. If I append a character in front of the first line, other than a space, then the preview works fine. I verified that text above previews as expected in Byword's preview and MMD Composer's preview.

Included are screen shots showing Byword and Marked previews.

  1. Support Staff 1 Posted by Brett on 20 Feb, 2013 07:44 PM

    Brett's Avatar

    It's not the number, it's the colon. MultiMarkdown looks for MMD-style metadata in the first lines before the first break. Your is interpreted as such. If you put a blank line in above it, it will solve the issue.

  2. Support Staff 2 Posted by Brett on 20 Feb, 2013 07:46 PM

    Brett's Avatar

    Actually, wait. Is the Title: line part of the document as well?

    -Brett

  3. 3 Posted by jason.verly on 20 Feb, 2013 07:55 PM

    jason.verly's Avatar

    Yes, the Title line is the first line in the MMD document.

  4. 4 Posted by jason.verly on 20 Feb, 2013 08:37 PM

    jason.verly's Avatar

    I can get the same text to preview in Byword and MMD Composer. I've attached the actual MMD doc to discussion.

  5. 5 Posted by jason.verly on 20 Feb, 2013 08:39 PM

    jason.verly's Avatar

    Yes, the 'Title' line is the first line in the document. I attached a copy of the MMD doc to the discussion thread.

  6. Support Staff 6 Posted by Brett on 20 Feb, 2013 08:56 PM

    Brett's Avatar

    Sorry, reading these over email and didn't see the attachment. It looks like in your first example that the feature that figures out where the last change to the text was may actually be breaking the tag in the first line. Could you try opening the same document and adding a line of text at the end, then saving and seeing how the preview updates?

  7. 7 Posted by jason.verly on 20 Feb, 2013 09:02 PM

    jason.verly's Avatar

    Added a line at the end of the MMD doc, clicked Save, and the Marked showed the added text but didn't show the "9:42am - Email from" line.

  8. Support Staff 8 Posted by Brett on 20 Feb, 2013 09:20 PM

    Brett's Avatar

    Ok, figured out what's going on. Marked strips the MMD header data (Title:) before rendering the preview to prevent MultiMarkdown from generating a complete HTML document. This is leaving the date line, though, which MMD is then recognizing as metadata because the title line and line break have already been stripped. This issue is solved for the next version.

    I realize it's inconvenient and I apologize, but could you --- for the time being --- reformat the documents such that the first line after the existing metadata did not contain a colon in the first 20 characters?

  9. 9 Posted by jason.verly on 20 Feb, 2013 09:34 PM

    jason.verly's Avatar

    No problem. I'll either do that or grab the HTML output from Byword.

  10. Brett closed this discussion on 10 Mar, 2013 02:17 AM.

Comments are currently closed for this discussion. You can start a new one.

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