fletcher / peg-multimarkdown

An implementation of MultiMarkdown in C, using a PEG grammar - a fork of jgm's peg-markdown. No longer under active development - see MMD 5.
Other
523 stars 55 forks source link

MMD major slowdown adding rows to table #135

Closed ian-brackenbury closed 12 years ago

ian-brackenbury commented 12 years ago

peg-multimarkdown version 3.6 mountain lion 10.8.2

I have a simple two-column table marked up and with the first three rows it translates OK but if I add another row it becomes very slow, and a fourth row its basically unusable. I have reinstalled MMD and support packages but makes no difference. Is it something obvious or a peculiarity of the data I'm using. or? ...Ian.

## KHString Methods ##

| KHString Method |  C String Library Equivalents |
| :------------------------------------------------ | :------------------------------------------------ |
| str = str | char *strcpy(char *dest, const char *src);
| str = substr(0,int).append(copies(int)) | char *strncpy(char *dest, const char *src, size_t n);
| str = substr(0,int) | void *memcpy(void *dest, const void *src, size_t n); 
| str = str | void *memmove(void *dest, const void *src, size_t n);  
| int = atoi() | int atoi( const char *str ); 
fletcher commented 12 years ago

This is related to having so many '*' characters inside the table cells. The italics parser has to work over time to compensate and figure out wh, hence the slowdown.

Since everything you are including is actually meant to be code, and not Markdown, enclose each of your code statements inside single quotes.

Alternatively you could skip blank lines between each row in table to split the table into sections, then each row is processed independently.

Finally, if you really want to include "improper" Markdown and not enclose it in code spans, you'll be better off using an HTML table for this.

ian-brackenbury commented 12 years ago

Precise and very helpful response, thank you.

(... assuming you meant back-ticks rather than regular quotes.)