problems adding table code

Dave Garbutt's Avatar

Dave Garbutt

22 Sep, 2013 05:23 PM

Hi,

When I am adding tables I find it very hard to ge them accepted as tables in Marked.

When all else fails I have solved problem by cutting and pasting a table header from the example document. Which works, kinda.
I suppose my problem Is I cannot see where the formatting mistake is..

1) problem is that the ----- bars in the line under the table header get turned into M and/or N -dashes. I think this is a text setting I set somewhere, now I cannot remember where. It happens intermittently, more often if focus is in the header line but not always then.
2) But even with the dashes OK the table is often not recognised. Sometimes the following things help:
  a) removing the two trailing spaces at the end of the row added when using tab between cells
  b) removing leading and trailing spaces in the top line between the | and header text. No idea which is right it is not mentioned in any guide I have checked (MMD nor MMC)
 c) copy paste header, as mentioned.

The symptom then is the table appears as just a paragraph with all the lines justified together.

The screen shot shows my current document with a table of species list. And table is ignored.

  1. Support Staff 1 Posted by Fletcher on 22 Sep, 2013 05:34 PM

    Fletcher's Avatar

    Dave,

    Sorry you're having trouble with tables.

    First step is to forget about Marked --- figure out whether the tables are interpreted correctly with Composer's built in preview. If it's working in Composer, and Marked isn't --- then you'll have to talk to Brett about that one if it is not correctly handling MMD tables.

    Obviously screen shots are nice, but it's more helpful to actually have the source document that is causing you trouble. People often paste strange characters into their document that are invisible and break things.

    The screenshot you includes shows an incomplete table with a single divider at the cut off line. That will prevent a table from being recognized.

    If you send me an actual document, I'll take a look.

    But generally, if you let Composer help you in creating the table, everything generally works fine. All you need to type is the first "|" to trigger a potential table, and then use the tab key after that when you want to close a cell, and hit return when you want to go the next line.

    FTP

  2. 2 Posted by Dave Garbutt on 23 Sep, 2013 03:09 PM

    Dave Garbutt's Avatar

    Thanks --

    I have not attached the document (see below). (it is messy because I am not finished tidying it up. It is a scan of an old report, so I am editing it and turning some parts into tables.).

    So one issue might be I have tabbed to end the line sometimes. I will use return instead. :-)

    The issue is also visible in the built-in preview for the record.
    Also I have removed the line with a single | and now the top of the table-in-progress is shown correctly.
    Let me know if you would still like to see the full document.

    best regards,

    Dave

    Thanks!

  3. 3 Posted by Dave Garbutt on 23 Sep, 2013 03:38 PM

    Dave Garbutt's Avatar

    By the way I should have mentioned that table entry in MMC is just brilliant and elastic tabs really add value because you can see the text lining up as you work.

    It is the easiest way to do tables in any software I have ever used!

  4. 4 Posted by Dave Garbutt on 23 Sep, 2013 03:48 PM

    Dave Garbutt's Avatar

    OK
    Now in the same document I have another table of the period people were in the camp.
    The different people had different patterns, so my idea is to have four columns for dates and then they match somewhat to calendar time. (Summer & Autumn, Winter, Spring & summer)
    It is not clear to me if I should have tabs in this table or not. perhaps just the first column?
    In any case there is a problem because the table swallows a row!

    Whole doc is attached, and screen shot of the table.

    Dave

  5. Support Staff 5 Posted by Fletcher on 23 Sep, 2013 06:28 PM

    Fletcher's Avatar

    Dave,

    The attachments you mentioned in your last message weren't there. I'm happy to take a look if you send them to me.

    Since I created Composer, I'm definitely biased, but I agree that the table entry is really easy in Composer. Almost everything you need for a basic table is done automatically.

    General things to remember:

    1) A partially complete table may or may not be a valid table. If it's not valid, it won't be displayed properly in the preview or in Marked. Those both expect a completed table. This is normal.

    2) Tabs aren't actually part of the table syntax -- they're ignored. It's entirely up to you whether to use them. But as you note, the elastic tabstop feature makes the use of tabs mandatory in my mind. Tables that look like tables while I'm writing them are just too valuable to not use that feature.

    3) Composer makes a lot of things really easy. That said, it's still valuable to understand the Markdown/MultiMarkdown syntax for troubleshooting purposes. Tables are a good example of this.

    4) MMD has been around for 8+ years or so. This means that *most* bugs have been sorted out since that time. On the other hand, the code has migrated from Perl to C, and then been almost completely rewritten in C -- leaving opportunity for me to introduce new bugs in the translation. And I've only had a really good test suite since the first C rewrite. Overall, this means that the vast majority of problems that people write in with (for the MMD syntax, not necessarily the Composer app) are problems with the source document. Most often, this is either misunderstanding of the syntax, typo, or text pasted from something like Word that contained embedded "gremlin" characters. It's the minority of the time that there is an actual problem with the MMD parser.

    5) This means that having a good approach to troubleshooting documents can be helpful. I describe one here:

    http://fletcher.github.io/peg-multimarkdown/#divideandconquer

    6) In this case, if the problem is a table, you can simply insert a blank line in the middle of the table and move that line up/down to find the trouble spot. Once you know the line with the problem, it's usually much easier to figure out what the problem is. Having invisible characters turned on (as you did) can be useful, but it doesn't show non-whitespace characters. If you copy/paste a lot, sometimes using an app like TextMate/TextWrangler can help identify "gremlins" as well.

    Enough rambling --- hopefully some of this helps, and if you need me to take a look at a document I'm happy to do it.

  6. 6 Posted by Dave Garbutt on 23 Sep, 2013 08:58 PM

    Dave Garbutt's Avatar

    oops, sorry. Forgotten attachment syndrome.

    here they are.

    I have already tried fixing by adding and removing the line end there before the Clare line. It is strange because it is swallowed into a cell that is not the last (backspace in the file ;-) Saw that in a filename once. That was fun to fix.

    BTW I have also attached a screenshot of Marked, since this table seems to work in there.

    Thanks for your help.
    Would it be possible to highlight wierd characters in red?
    This file should be pukka since it came from a scanner or some bits typed.

    Dave

  7. Support Staff 7 Posted by Fletcher on 23 Sep, 2013 11:17 PM

    Fletcher's Avatar

    You have too many apostrophes, and it's confusing the parser while it looks for matched pairs of single quotes.

    Either delete them (e.g. "1982" instead of " '82 "), or escape them (" \'82 ").

    I'm assuming you're not finished with the last two tables and understand why they don't work.

    F-

    --
    Fletcher T. Penney
    Manager, Founder
    MultiMarkdown Software, LLC
    [email blocked]

  8. 8 Posted by Dave Garbutt on 24 Sep, 2013 09:30 AM

    Dave Garbutt's Avatar

    Thanks I tried this and it is OK now.
    I have added the year to the columns which also saves space.

    Yes I am aware the other tables are not done. The scanner / OCR made a real pig's ear of the table layout, treating it as two columns. So I have to work on it a lot.

    Thanks

  9. Support Staff 9 Posted by Fletcher on 24 Sep, 2013 07:23 PM

    Fletcher's Avatar

    Glad it's working for you!

    F-

    --
    Fletcher T. Penney
    Manager, Founder
    MultiMarkdown Software, LLC
    [email blocked]

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