GithubHelp home page GithubHelp logo

fletcher / multimarkdown-4 Goto Github PK

View Code? Open in Web Editor NEW
306.0 34.0 59.0 6.76 MB

This project is now deprecated. Please use MultiMarkdown-6 instead!

Home Page: https://github.com/fletcher/MultiMarkdown-5

License: Other

C 94.26% Makefile 2.78% Perl 1.24% Shell 1.52% Batchfile 0.21%

multimarkdown-4's Introduction

Title: MultiMarkdown 4 ReadMe
Author: Fletcher T. Penney
Base Header Level: 2

Introduction

Markdown is a simple markup language used to convert plain text into HTML.

MultiMarkdown is a derivative of Markdown that adds new syntax features, such as footnotes, tables, and metadata. Additionally, it offers mechanisms to convert plain text into LaTeX in addition to HTML.

Background

MultiMarkdown started as a Perl script, which was modified from the original Markdown.pl.

MultiMarkdown v3 (aka 'peg-multimarkdown') was based on John MacFarlane's peg-markdown. It used a parsing expression grammar (PEG), and was written in C in order to compile on almost any operating system. Thanks to work by Daniel Jalkut, MMD v3 was built so that it didn't have any external library requirements.

MultiMarkdown v4 is basically a complete rewrite of v3. It uses the same basic PEG for parsing (Multi)Markdown text, but otherwise is almost completely rebuilt:

  • The code is designed to be easier to maintain --- it's divided into separate files on a more logical structure
  • All memory leaks (to my knowledge) have been fixed
  • greg is used instead of peg/leg to create the parser --- this allows the parser to be thread-safe
  • The test suite has been modified to account for several improvements. MMD should fail one of the basic Markdown tests (see peg-markdown for more information).
  • Command line options are slightly different.

Installation

You can compile for yourself, or download a precompiled binary from the downloads page.

  • Download the source from the github web site using git
  • git submodule init and then git submodule update to download greg and the test suite
  • Run make to compile.
  • Run make test-all | less to verify that the build is correct. As mentioned, one of the tests is expected to fail; the rest should pass on all systems.
  • Run sudo make install and (optionally) sudo make install-scripts to install multimarkdown and the helper scripts.

Usage

Once installed, you simply do something like the following:

  • multimarkdown file.txt --- process text into HTML.

  • multimarkdown -c file.txt --- use a compatibility mode that emulates the original Markdown.

  • multimarkdown -t latex file.txt --- output the results as LaTeX instead of HTML. This can then be processed into a PDF if you have LaTeX installed. You can further specify the LaTeX Mode metadata to customize output for compatibility with memoir or beamer classes.

  • multimarkdown -t odf file.txt --- output the results as an OpenDocument Text Flat XML file. Does require the plugin be installed in your copy of OpenOffice, which is available at the peg-multimarkdown-downloads page. LibreOffice includes this plugin by default.

  • multimarkdown -t opml file.txt --- convert the MMD text file to an MMD OPML file, compatible with OmniOutliner and certain other outlining and mind-mapping programs (including iThoughts and iThoughtsHD).

  • multimarkdown -h --- display help and additional options.

  • multimarkdown -b *.txt --- -b or --batch mode can process multiple files at once, converting file.txt to file.html or file.tex as directed. Using this feature, you can convert a directory of MultiMarkdown text files into HTML files, or LaTeX files with a single command without having to specify the output files manually. CAUTION: This will overwrite existing files with the html or tex extension, so use with caution.

Notes

If you get an error that greg fails to build try touch greg/greg.c. I had an issue where the timestamp on that file might have been too old, which caused the build to fail.

LyX Support

Charles R. Cowan (https://github.com/crcowan) added support for conversion to LyX. Support for this should be considered to be in alpha/beta, and is not guaranteed. Issues related to LyX can be added to the MultiMarkdown issues page on github, but will need to be answered by Charles. I am happy to include this code in the main MMD repo, but since I don't use LyX I can't support it myself. If this arrangement becomes a problem, then LyX support can be removed and it can be kept as a separate fork.

More Information

To get more information about MultiMarkdown, check out the website or User's Guide.

multimarkdown-4's People

Contributors

ceeeeej avatar crcowan avatar danielpunkass avatar fletcher avatar fordmason avatar gverdier avatar magnusmorton avatar mlilback avatar njmsdk avatar odnamrataizem avatar ryoon avatar van-de-bugger avatar wabain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

multimarkdown-4's Issues

Building 4.3 on Mac: new failures for old?

Building 4.3 on Mac (looking for fix to #17), I'm getting more than the expected 2 FAILED. Also looks like one test is passing that's expected to fail. Is this the new normal?

> make test-all | grep -i fail
    echo "** It's expected that we fail the \"Ordered and unordered lists\" test **"; \
Ordered and unordered lists ... FAILED
22 passed; 1 failed.
** It's expected that we fail the "Ordered and unordered lists" test **
Edge Cases ... FAILED
29 passed; 1 failed.
26 passed; 0 failed.
Edge Cases ... FAILED
Headers ... FAILED
28 passed; 2 failed.
1 passed; 0 failed.
22 passed; 0 failed.
30 passed; 0 failed.
30 passed; 0 failed.
1 passed; 0 failed.
1 passed; 0 failed.

Down-casing inconsistent on href/id

Is it a rule that "labels" (internal hrefs) have to be lower case? I can't find that documented. But if I try upper case, the href's get down-cased but the id's do not:

> cat bug.md
Lorem ipsum [SOA record] [SOA] magni dolores.
# Nam libero tempore [SOA]

but ....

> multimarkdown bug.md
<p>Lorem ipsum <a href="#soa">SOA record</a> magni dolores.</p>
<h1 id="SOA">Nam libero tempore</h1>

The href to "#soa" doesn't connect to the id "SOA" (as of course it should not).

MultiMarkdown version 4.2

LinkReference

Is there a way to get the LinkReferences from the parsed document?

I tried to add a printf call in LinkReference in the leg file, I saw the outputs, but I could not see them in anywhere in the parsed node.

Here is what I did:

LinkReference = a:StartList NonindentSpace !"[]" l:Label ':' Spnl s:RefSrc
        t:RefTitle
        ( &{ !ext(MMD_EXT_COMPATIBILITY) } <Attributes { a = reverse_list($$); } )?>
        BlankLine+
        { 
            /* Get label for referencing */
            GString *text = g_string_new("");
            char *clean;
            print_raw_node_tree(text, l->children);
            clean = clean_string(text->str);

printf("!!! LINKREF !!!\n");

            if (a == NULL) {
                /* no attributes */
                $$ = mk_link(NULL, clean, s->str, t->str, NULL);
            } else {
                $$ = mk_link(NULL, clean, s->str, t->str, a);
            }
            g_string_free(text, TRUE);
            free_node(s);
            free_node(t);
            free_node_tree(l);
            free(clean);

            $$->key = MMD_LINKREFERENCE;
        }

and I use the following function to print the node:

void print_tree(node *list, int level)
{
    if (!list) return;
    node *p = list;
    while (p) {
        int i; for (i = 0; i < level; i++) printf(" ");
        printf("[%d] %s\n", p->key, p->str);
        if (p->children) print_tree(p->children, level+1);
        p = p->next;
    }
}

/* print_html_node_tree -- convert node tree to HTML */
void print_html_node_tree(GString *out, node *list, scratch_pad *scratch) {
    print_tree(list, 0); return;
    while (list != NULL) {
        print_html_node(out, list, scratch);
        list = list->next;
    }
}

print_tree was used and the original html printing code was short-circuited.

then I use ./multimarkdown README.md (the one in MultiMarkdown-4 git repo), I could see

!!! LINKREF !!!
!!! LINKREF !!!
!!! LINKREF !!!
!!! LINKREF !!!
!!! LINKREF !!!
!!! LINKREF !!!

but in print_tree output, there were NO key which type is 60 (LINKREFERENCE).

Metadata and HTML snippets

I'm proposing the following as an enhancement.

When producing html output I see no point in generating the entire document when some metadata (besides Base Header Level and Quotes Language) is specified. Say, for example, the latex memoir stuff. Sometimes I want to produce both latex and html from the same md source.

But besides this metadata could be useful for custom postprocessors that generate the prologue and epilogue. In this case one doesn't wan't mmd to produce a complete document while one does want the metadata (both mmd and custom metadata).

So why not add a couple of cli options to help cope with the above scenarios:

--snippet: to force snippet generation, ignoring the metadata.

--metadata: list the available metadata (useful to use with --extract).

The --snippet option is important for this proposal, --metadata is just desirable (to avoid parsing the header just to get the list of metadata).

`code` swallows leading whitespace

This markdown:

[`  asp   Book`](#aspbook) *property*</br>

produces this HTML:

<p><a href="#aspbook"><code>asp   Book</code></a> <em>property</em></br>

The leading spaces in the code section got swallowed, while the spaces inside were preserved. MultiMarkdown version 4.5.

Use $CC

The Makefile is hardcoded to compile with gcc. Please use the value of the environment variable $CC instead so that the builder can select a different compiler without having to patch your Makefile.

Non-breaking Space

I would really like a non-breaking space character for MultiMarkdown that would generate &nbsp; for HTML and ~ for LaTeX.

In a workflow that I built on top of MultiMarkdown and LaTeX, I had been using ~ in my source documents — it got left in there in the HTML output and LaTeX just did the Right Thing™.

Unfortunately, in the latest version of MultiMarkdown, the ~ is interpreted as meaning that I want the following text wrapped in <sub>.

Possible bug with empty lines in lists

This code

- Listitem 1
- Listitem 2
- Listitem 3

produces this HTML:

<ul>
<li>Listitem 1</li>
<li>Listitem 2</li>
<li>Listitem 3</li>
</ul>

But this code

- Listitem 1
- Listitem 2

- Listitem 3

produces the follwing HTML:

<ul>
<li><p>Listitem 1</p></li>
<li><p>Listitem 2</p></li>
<li><p>Listitem 3</p></li>
</ul>

Is there a reason, why all the list items are now wrapped in <p>-Tags? I'd consider this a bug, unless it is meant as a feature (but what is the pupose?). The behavior is the same for unordered and ordered lists.

Normally this isn't visible in a browser, but if somebody defines a line height via CSS of, say 1.5em, the list looks different.

Bracket pairs spanning multiple lines

I had the following table fragment:

| Key Equivalent | Action                                 |
| -------------- | -------------------------------------- |
| ⌘←, ⌘[         | Go back in history                     |
| ⌘→, ⌘]         | Go forward in history                  |

The HTML produced is:

<table>
<colgroup>
<col style="text-align:left;"/>
<col style="text-align:left;"/>
</colgroup>

<thead>
<tr>
    <th style="text-align:left;">Key Equivalent</th>
    <th style="text-align:left;">Action</th>
</tr>
</thead>

<tbody>
<tr>
    <td style="text-align:left;">⌘←, ⌘[ | Go back in history |
| ⌘→, ⌘]</td>
    <td style="text-align:left;">Go forward in history</td>
</tr>
</tbody>
</table>

The problem is that the two brackets are found and considered marking a link, though as can be seen from the resulting HTML, no link is actually produced.

I think it’s worth considering some stricter rules regarding brackets, for example that an opening bracket ([) must be immediately followed by non-whitespace, to be considered a link. And if linking fails, it should be treated as a literal bracket.

Or perhaps opening brackets should just always be escaped?

Problem with id generation

ID’s are not generated the same way on OSX and Windows when using accented characters. For example

# Table des matières

will output on OSX

<h1 id="tabledesmatires">Table des matières</h1>

but will output on Windows

<h1 id="tabledesmatières">Table des matières</h1>

Both output are wrong. The Windows one is even invalid. What I expect is

<h1 id="tabledesmatieres">Table des matières</h1>

or better

<h1 id="table_des_matieres">Table des matières</h1>

Bug in figure dimension attributes:

[fig:fig]: fig.pdf "" width="75%" height="75%"

is translating into:

\includegraphics[width=$.4f\textwidth,height=$.4f\textheight]{fig.pdf}

instead of:

\includegraphics[width=.75\textwidth,height=.75\textheight]{fig.pdf}

Interlnal links does not work for non-Latin alphabets

OS: Linux.
MultiMarkdown: 4.3.1, built from resent sources.

Source text:

## Содержание

* [Заголовок 1]
* [Заголовок 2]

## Заголовок 1

Раздел 1...

## Заголовок 2

Раздел 2...

Command line:

$ multimarkdown -f -o text.html text.mmd

Result:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
</head>
<body>
<h2 id="">Содержание</h2>

<ul>
<li><a href="#">Заголовок 1</a></li>
<li><a href="#">Заголовок 2</a></li>
</ul>

<h2 id="">Заголовок 1</h2>

<p>Раздел 1&#8230;</p>

<h2 id="">Заголовок 2</h2>

<p>Раздел 2&#8230;</p>

</body>
</html>

Almost everything is ok, but id attributes: they are empty. Currently multimarkdown filters out all the characters but Latin letters, digits and underscore to form a valid id. That was ok for html4, but html5 allows id to contain any characters except spaces:

3.2.3.1 The id attribute

The id attribute specifies its element's unique identifier (ID). [DOM]

The value must be unique amongst all the IDs in the element's home subtree and must contain at least one character. The value must not contain any space characters.

Note: There are no other restrictions on what form an ID can take; in particular, IDs can consist of just digits, start with a digit, start with an underscore, consist of just punctuation, etc.

Note: An element's unique identifier can be used for a variety of purposes, most notably as a way to link to specific parts of a document using fragment identifiers, as a way to target an element when scripting, and as a way to style a specific element from CSS.

Identifiers are opaque strings. Particular meanings should not be derived from the value of the id attribute.

(Taken from http://www.w3.org/TR/html5/dom.html#the-id-attribute.)

As I see, output file looks like a html5 file: it uses <!DOCTYPE html> and <meta charset="utf-8"/>. Could you please allow html5 ids as well?

Thanks.

LaTeX and Code Blocks

I opened a ticket on the wrong repo, referring to the wrong version (fletcher/peg-multimarkdown#150) 😉 Now I have updated (Most current version from the page, and in the code on the master branch it's the same issue).

The Code Blocks work exactly as expected when converting to HTML. When I convert to LaTeX and give an explicit language it is written in though, I get a problem. This is the Markdown Code (ignore the slash... I don't know how to create the code block inside the code block...):

```clojure
(:require clojure.string)
\```

This will result in the following HTML Code, which is awesome:

<pre><code class="clojure">(:require clojure.string)
</code></pre>

But it will translate into the following LaTeX Code (which is not so awesome):

\begin{verbatim}
(:require clojure.string)
\end{verbatim}

This doesn't make a lot of sense. What it should actually do is the following:

\begin{lstlisting}[language=clojure]
(:require clojure.string)
\end{lstlisting}

Then you get Code Highlighting and so on via the standard listing package 😄 If you (like me) don't want to use that package, but minted for example, you can define lstlisting in your header file using that package.

PS: MultiMarkdown is great. Currently trying it out with a smaller project, if it turns out well, I will use it for my master thesis next year 😄 I searched for a way to create the body of my LaTeX documents in Markdown, and there it is!

Intralinks are not processed within div element.

OS: Linux.
MultiMarkdown: 4.3.1, built from resent sources.

Source text:

## Contents

* [Heading 1]
* [Heading 2]

## Heading 1

Section 1...

## Heading 2

Section 2...

Command line:

$ multimarkdown -f -o text.html text.mmd

Result:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
</head>
<body>
<h2 id="contents">Contents</h2>

<ul>
<li><a href="#heading1">Heading 1</a></li>
<li><a href="#heading2">Heading 2</a></li>
</ul>

<h2 id="heading1">Heading 1</h2>

<p>Section 1&#8230;</p>

<h2 id="heading2">Heading 2</h2>

<p>Section 2&#8230;</p>

</body>
</html>

Everything is ok.

Now I want to enclose the text into a div element:

<div markdown="1">

## Contents

* [Heading 1]
* [Heading 2]

## Heading 1

Section 1...

## Heading 2

Section 2...

</div>

Command line is the same as before. Result:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
</head>
<body>
<div>

<h2 id="contents">Contents</h2>

<ul>
<li>[Heading 1]</li>
<li>[Heading 2]</li>
</ul>

<h2 id="heading1">Heading 1</h2>

<p>Section 1&#8230;</p>

<h2 id="heading2">Heading 2</h2>

<p>Section 2&#8230;</p>
</div>

</body>
</html>

div element is added, headings are ok, but links in Contents are not processed as expected.

Adding extra brackets does not help:

* [Heading 1][]

Remains unprocessed. I am not very sure, but it looks like a bug.

footnotes put return link at end of first paragraph of multi-paragraph notes

I'll caveat this by saying that i realize, looking at the mmd-test-suite that this appears to be the 'tested' behavior but it doesn't really jibe with the footnotes section of the human-markdown-reference (which, i think at least, makes more sense) here:

otherwise, mmd4 is pretty rockin. If this is the new default behavior, could you maybe add in a flag to enable the old behavior (or saving that, let me know where i can poke around to change the behavior on my own machine)? Thanks!

Force full with LaTeX

Shouldn't this generate a complete document?:

[carlos@netbook ~]$ cat doc.md 
something
[carlos@netbook ~]$ multimarkdown -f -t latex doc.md 

something

Elements <ins> and <del> are wrapped in <p> tags

If on a single line (preceded and followed by a single line), these elements are wrapped in p-tags. This makes it impossible to mark, for example, a complete table or multiple paragraphs for deletion or insertion.

It would be nice if also the mark-element wouldn't be wrapped, but this would probably violate the HTML specification (for which, in this case, the user is responsible, not MMD).

Empty output with -a or -r (accept/reject CriticMarkup)

I get an empty output whenever I use -a or -r with MultiMarkdown 4.5 installed with Homebrew in OS X Mavericks. This is a minimal document:

MultiMarkdown {~~cannot->can also~~} process CriticMarkup.

multimarkdown test.mmd is ok, but multimarkdown -a test.mmd produces no output.

Which makes me wonder: is CriticMarkup support embedded in the executable?

Multiparagraph footnotes only showing first paragraph

Looks like a bug to me:

this is a footnote [^fnote]

[^fnote]: first paragraph

    second paragraph

=>

<p>this is a footnote <a href="#fn:1" id="fnref:1" title="see footnote" class="footnote">[1]</a></p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>first paragraph <a href="#fnref:1" title="return to article" class="reversefootnote">&#160;&#8617;</a></p>
</li>

</ol>
</div>

MultiMarkdown 4.2 can not convert footnotes properly

Hi Fletcher, I am very like MultiMarkdown, but when I try to output a mmd file to html, the footnotes display incorrect as below:

image

The html source code as below:

image

And the mmd file as below:

image

This mmd file can be downloaded at https://dl.dropboxusercontent.com/u/2343314/lesson.mmd. BTW, this file contain some Chinese characters.

I think I have done all of the same things write in MultiMarkdown User’s Guide Version 3.2, but the result is bad, please help me, thanks a lot.

I use MultiMarkdown 4.2 portable version for Windows, and OS is Windows 7 Ultimate 32-bit.

Ordered list in .fodt

Shouldn't the .fodt processor be creating a style "P1" with a list "L1" and when emiting a LISTITEM within an ordered list, use style "P1" rather than "P2"?

Trouble Compiling on Ubuntu 13.04

Hi. I don't know if this is the place to put it, but I'm having some difficulty compiling the Multimarkdown 4 source on Ubuntu 13.04: I think it's a Greg problem but I can't see what the error is. I followed your instructions successfully through to make and then this is what I get:

gcc -c -Wall -g -O3 -include GLibFacade.h -o parse_utilities.o parse_utilities.c parse_utilities.c:24:0: warning: ignoring #pragma mark [-Wunknown-pragmas] parse_utilities.c:203:0: warning: ignoring #pragma mark [-Wunknown-pragmas] CC=gcc make -C greg make[1]: Entering directory /home/myname/MultiMarkdown-4/greg'
test -f greg && ./greg -o greg-new.c greg.g
make[1]: *** [greg.c] Error 1
make[1]: Leaving directory /home/myname/MultiMarkdown-4/greg' make: *** [greg/greg] Error 2

Perhaps it's an issue at my end, or with Greg - I'm not literate enough to know, but being the first person I can see flagging this suggests that I'm the one in the wrong - but I thought I'd flag it just in case. Any guidance would be much appreciated.

Feature Request: Multifile documents

Hi,

I'm trying to use multimarkdown to generate some user documentation at work. We produce several user manuals and some chapters are mostly identical between those manuals. We would like to write those chapters once and load them on all manuals.

We are switching to multimarkdown in order to produce our documentation both in pdf and in html from the same source (we only had pdf before).

Any ideas? Is there someone interested? I could spend some time on this next February, but I don't know where to start. Any guidance would be appreciated.

Regards,
Miguel

Syntax proposal for tables

Looking at issue #49 it seems that 'correct' column alignment isn't possible with the indicators in the alignment/divider line alone. The following syntax proposal could help. The basic idea is to allow individual cell alignment by using colons in a similar same way they are used in the alignment/divider line:

|    Col A    |    Col B    |    Col C    |
| ----------- | ----------- | ----------- |
|   Cell 1A   |:  Cell 1B  :|   Cell 1C  :|
|:  Cell 2A   |:  Cell 2B               :||

The alignment of Cell 1A is driven by the system as before, Cell 1B is centered, Cell 1C is right aligned, Cell 2A is left aligned and Cell 2B is centered.

|    Col X    |    Col Y    |    Col Z    |
| :---------- | :---------: | ----------: |
|   Cell 1X   |   Cell 1Y   |   Cell 1Z   |
|   Cell 2X  :|:  Cell 2Y   |:  Cell 2Z  :|

The alignment of the cells in the first row is controlled by the alignment/divider line as before, Cell 2X is right aligned, Cell 2YC is left aligned and Cell 2Z is centered.

In general, the following rules should apply:

  1. There must be no space between the pipe and the colon(s) which indicate alignment. If there is a space, the colon is considered to be cell text.
  2. Cell alignment with colons always overrides column alignment driven by the alignment/divider line.
  3. Cell alignment with colons is available for cells in the table header and the table body.
  4. Left or center alignment in the first cell of a row require the use of the pipe at the beginning of the line.
  5. Right or center alignment in the last cell of a row require the use of the pipe at the end of the line.

I know that you are cautious in syntax extensions (for good reasons) but maybe you can consider this extension. Cell alignment is hard to get right with CSS or XSLT after MMD conversion for arbitrary tables.

It is also clear that this extension would break backwards compatibility with (a small amount of) existing documents, so it probably needs to be controllable with a command-line switch or a metadata key.

Thanks,
Michael

<pre markdown="1"> works incorrectly.

Fedora 20, x86_64, multimarkdown built from fresh git sources.

$ multimarkdown --version

MultiMarkdown version 4.5
Copyright (c) 2013 Fletcher T. Penney.

portions based on peg-markdown - Copyright (c) 2008-2009 John MacFarlane.
peg-markdown is Licensed under either the GPLv2+ or MIT.
portions Copyright (c) 2011 Daniel Jalkut, MIT licensed.

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$ cat foo.mmd 
<pre>
*a*
</pre>
<pre markdown="1">
*a*
</pre>

$ multimarkdown foo.mmd 
<pre>
*a*
</pre>
<p re >
<em>a</em>
</pre>

Note the incorrect "<p re >" tag.

Documentation submodule broken

Hi,

After cloning MultiMarkdown-4, trying to git submodule update --init causes:

…
Cloning into 'documentation'...
remote: Reusing existing pack: 1187, done.
remote: Total 1187 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (1187/1187), 1.49 MiB | 682.00 KiB/s, done.
Resolving deltas: 100% (751/751), done.
Checking connectivity... done
fatal: reference is not a tree: 8620ba91e38c98b08eb7f28694a96d311148cc68
…

The error prevents downloading and installing with Homebrew as of today.

Add alternate markup for new table section.

Currently the doc states:


You can create multiple <tbody> tags within a table by having a single empty
line between rows of the table. This allows your CSS to place horizontal borders to
emphasize different sections of the table.

However using tools such as Table Editor (https://github.com/vkocubinsky/SublimeTableEditor) the addition of a section through an empty line, looses the context that allows to maintain the different sections of the table together.

Maybe allowing an alternate "New Section" markup would make it easier to keep tables visually connected when they're in the same section while allowing to visually separate them neatly with visual aids that Table Editor provides?

Here's my proposition:


| A   | B   |
| --- | --- |
| C   | D   |

| E   | F   |

Currently this renders with a tbody around the E / F row as expected.


| A   | B   |
| --- | --- |
| C   | D   |
|
| E   | F   |

This currently breaks the table, however it could allow to quickly (only one more keypress) obtain the same effect as above while adding a visual connection to the different sections of the table.�


| A   | B   |
| --- | --- |
| C   | D   |
|     |     |
| E   | F   | 

This currently renders the empty cell row as empty tds. If empty rows marked new sections, it would allow the visual candy of seeing pipes neatly aligned while using tools like Table Editor. For instance the sample table markup would look like this after a few reformatting tab presses (see improvement request):


|              | Grouping                    ||
| First Header | Second Header | Third Header |
| ------------ | :-----------: | -----------: |
| Content      |         *Long Cell*         ||
| Content      |    **Cell**   |         Cell |
|
| New section  |      More     |         Data |
| And more     |           And more          ||
[Prototype table]

Or this


|              | Grouping                    ||
| First Header | Second Header | Third Header |
| ------------ | :-----------: | -----------: |
| Content      |         *Long Cell*         ||
| Content      |    **Cell**   |         Cell |
|              |               |              |
| New section  |      More     |         Data |
| And more     |           And more          ||
[Prototype table]

Which feels to me more readable than the single empty line. But I'm aware of how subjective this is...

Strong/Emph parser edge case

MMD-4 inherited a subtle bug in strong/emph parsing. I say subtle because no one has reported it to me after several years of use.

I pushed a commit today that fixes one known issue with strong/emph parsing that was a regression that occurred during another fix. When adding some further possible edge cases to the test suite, I stumbled across a new problem that also existed in peg-markdown.

I don't have a fix yet, and will work on one that hopefully does not overcomplicate the parser or slow down processing.

windows: use basedir in shell (batch) scripts

The windows scripts always assume the mmd is in the path. The fix is to use %dp0\multimarkdown instead of multimarkdown -- this way the tool will work when multimarkdown.exe is not in the path. (if you prefer, I can do a pull request: here are the changes danieldc@76ddb95)

Also, the windows script installer uses c:\windows\system32 -- does not work when user does not have full admin rights, and makes it harder for the portable use case. (it also breaks when the user did not installed windows in c:\windows, but that is rare -- the fix will be to use %SystemRoot%)

Compile JavaScript library?

Why not use Emscripten to produce a super high-performance markdown javascript library for the browser? Could end up being used on StackOverflow and Github! ;)

problem referencing glossary footnotes

When i try to add a glossary entry in a footnote, it's not included in the document:

This is my text[^note1]

[^note1]: glossary: text
  text is a wonderful thing[^note2]

[^note2]: glossary: thing
  This text will not be included in the document!

error in README.md: `touch greg\greg.c`

kbriggs:~/Downloads> git clone https://github.com/fletcher/MultiMarkdown-4
Cloning into 'MultiMarkdown-4'...
remote: Counting objects: 278, done.
remote: Compressing objects: 100% (121/121), done.
remote: Total 278 (delta 161), reused 259 (delta 152)
Receiving objects: 100% (278/278), 117.98 KiB, done.
Resolving deltas: 100% (161/161), done.

kbriggs:/Downloads> cd MultiMarkdown-4/
kbriggs:
/Downloads/MultiMarkdown-4> git submodule init
Submodule 'MarkdownTest' (https://github.com/fletcher/MMD-Test-Suite.git) registered for path 'MarkdownTest'
Submodule 'Support' (https://github.com/fletcher/MMD-Support.git) registered for path 'Support'
Submodule 'greg' (https://github.com/nddrylliog/greg.git) registered for path 'greg'

kbriggs:~/Downloads/MultiMarkdown-4> git submodule update
Cloning into 'MarkdownTest'...
[...]
Submodule path 'greg': checked out '5c08455fbf91edcddae7a7dadef6cdb534a90cb0'

kbriggs:~/Downloads/MultiMarkdown-4> make
gcc -c -Wall -g -O3 -include GLibFacade.h -o multimarkdown.o multimarkdown.c
gcc -c -Wall -g -O3 -include GLibFacade.h -o parse_utilities.o parse_utilities.c
parse_utilities.c:24:0: warning: ignoring #pragma mark [-Wunknown-pragmas]
parse_utilities.c:203:0: warning: ignoring #pragma mark [-Wunknown-pragmas]
CC=gcc make -C greg
make[1]: Entering directory /home/kbriggs/Downloads/MultiMarkdown-4/greg' test -f greg && ./greg -o greg-new.c greg.g make[1]: *** [greg.c] Error 1 make[1]: Leaving directory/home/kbriggs/Downloads/MultiMarkdown-4/greg'
make: *** [greg/greg] Error 2

kbriggs:/Downloads/MultiMarkdown-4> touch greg\greg.c
kbriggs:
/Downloads/MultiMarkdown-4> make
CC=gcc make -C greg
make[1]: Entering directory /home/kbriggs/Downloads/MultiMarkdown-4/greg' test -f greg && ./greg -o greg-new.c greg.g make[1]: *** [greg.c] Error 1 make[1]: Leaving directory/home/kbriggs/Downloads/MultiMarkdown-4/greg'
make: *** [greg/greg] Error 2

kbriggs:/Downloads/MultiMarkdown-4> touch greg/greg.c
kbriggs:
/Downloads/MultiMarkdown-4> make
[ok!]

Label capitalisation

Explicit heading labels are being converted to lowercase, but references are not.

For example:

Chapter Introduction [Chapter_Introduction]
-------------------------------------------

...

This is a reference to the introduction [](#Chapter_Introduction).

is transformed into:

\section{Introduction }
\label{chapter_introduction}

...

This is a reference to the introduction \autoref{Chapter_Introduction}.

xelatex then fails to resolve that reference.

Tested on a build from the latest repository checkout.

Issue with greg

This is a greg issue that must be addressed upstream but currently there is no way to build greg without having greg itself, because the Makefile bootstraps the build from a previous assumed to be there binary. So it's not possible to build multimarkdown either. I (and others before) have reported the problem to greg developer but the issue is still open since 2 months ago. Maybe a workaround is in order here to allow multimarkdown to build.

Nested block-level tags gets wrapped in <p>

If I run multimarkdown --process-html on the following markup:

<header>
<div class="nav">
foo

</div>
<div class="toc">
bar

</div>
</header>

I get the following HTML:

<header>
<div class="nav">
foo

<p></div>
<div class="toc">
bar</p>
</div>
</header>

Here </div> is wrapped in a <p> tag.

Possible bug in table formatting

I have the follwing table code:

|    Col A    |    Col B    |    Col C     |
| :---------- | :---------: | -----------: |
|   Cell 1A   |   Cell 1B   |    Cell 1C   |
|   Joined Cell 2A         ||    Cell 2B   |
|   Cell 3A   |       Joined Cell 3B      ||
|   Cell 4A   |   Cell 4B   |    Cell 4C   |

Converting this code with MMD 4.5 this results in a table where Cell 2B is centered. While the alignment of Joined Cell 2A and Joined Cell 3B are clearly debatable I think that everybody would excpect that Cell 2B should be right aligned since this cell doesn't really differ from cell Cell 1C.

Michael

table

'command not found error' : newbie problem?

hi folks,

i'm new to open source and linux. trying to make multimarkdown on my 64 bit macbook pro running os x mavericks. make seems to proceed fine, and i end up with a file called multimarkdown in my target directory. but i cannot execute multimarkdown, it throws 'command not found' error. here is the pertinent info:

➜  MultiMarkdown-4 git:(master) file multimarkdown
multimarkdown: Mach-O 64-bit executable x86_64 
➜  MultiMarkdown-4 git:(master) ls -l multimarkdown
-rwxr-xr-x  1 jhwright  staff  507488 Dec  8 22:27 multimarkdown 
➜  MultiMarkdown-4 git:(master) multimarkdown
zsh: command not found: multimarkdown

is there something obvious that i don't know here?

thanks!

jeff

MarkdownTest reference hash is invalid

When attempting to build MultiMarkdown-4 the process fails during the submodule update process with an invalid reference to MarkdownTest

$ git submodule init
Submodule 'MarkdownTest' (https://github.com/fletcher/MMD-Test-Suite.git) registered for path 'MarkdownTest'
Submodule 'Support' (https://github.com/fletcher/MMD-Support.git) registered for path 'Support'
Submodule 'cheat-sheet' (https://github.com/fletcher/human-markdown-reference.git) registered for path 'cheat-sheet'
Submodule 'documentation' (https://github.com/fletcher/MultiMarkdown-4.git) registered for path 'documentation'
Submodule 'greg' (https://github.com/nddrylliog/greg.git) registered for path 'greg'
$ git submodule update
Initialized empty Git repository in /home/mhanby/software/MultiMarkdown-4/MarkdownTest/.git/
remote: Reusing existing pack: 2168, done.
remote: Total 2168 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (2168/2168), 561.25 KiB, done.
Resolving deltas: 100% (1430/1430), done.
fatal: reference is not a tree: c6e9623b1eaa60fcbd865f1ba53fe960258c230c
Unable to checkout 'c6e9623b1eaa60fcbd865f1ba53fe960258c230c' in submodule path 'MarkdownTest'

Possible issue with horizontal rules

Three or more hyphens are not rendered as horizontal rule if not followed by an empty line.

Simple test case:

foo

---
bar

is converted in

<p>foo</p>

<p>&#8212;
bar</p>

while

foo

---

bar

is converted in

<p>foo</p>

<hr />

<p>bar</p>

I don't know if this is the actual correct behavior.
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.