Code Monkey home page Code Monkey logo

multimarkdown's Introduction

NAME
    MultiMarkdown

SYNOPSIS
    MultiMarkdown.pl [ --html4tags ] [ --version ] [ -shortversion ] [
    *file* ... ]

DESCRIPTION
    MultiMarkdown is an extended version of Markdown. See the website for
    more information.

            http://fletcherpenney.net/multimarkdown/

    Markdown is a text-to-HTML filter; it translates an easy-to-read /
    easy-to-write structured text format into HTML. Markdown's text format
    is most similar to that of plain text email, and supports features such
    as headers, *emphasis*, code blocks, blockquotes, and links.

    Markdown's syntax is designed not as a generic markup language, but
    specifically to serve as a front-end to (X)HTML. You can use span-level
    HTML tags anywhere in a Markdown document, and you can use block level
    HTML tags (like <div> and <table> as well).

    For more information about Markdown's syntax, see:

        http://daringfireball.net/projects/markdown/

OPTIONS
    Use "--" to end switch parsing. For example, to open a file named "-z",
    use:

            Markdown.pl -- -z

    --html4tags
        Use HTML 4 style for empty element tags, e.g.:

            <br>

        instead of Markdown's default XHTML style tags, e.g.:

            <br />

    -v, --version
        Display Markdown's version number and copyright information.

    -s, --shortversion
        Display the short-form version number.

BUGS
    To file bug reports or feature requests (other than topics listed in the
    Caveats section above) please send email to:

        [email protected] (for Markdown issues)
        
        [email protected] (for MultiMarkdown issues)

    Please include with your report: (1) the example input; (2) the output
    you expected; (3) the output (Multi)Markdown actually produced.

AUTHOR
        John Gruber
        http://daringfireball.net/

        PHP port and other contributions by Michel Fortin
        http://michelf.com/

        MultiMarkdown changes by Fletcher Penney
        http://fletcherpenney.net/

COPYRIGHT AND LICENSE
    Original Markdown Code Copyright (c) 2003-2007 John Gruber
    <http://daringfireball.net/> All rights reserved.

    MultiMarkdown changes Copyright (c) 2005-2009 Fletcher T. Penney
    <http://fletcherpenney.net/> All rights reserved.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are
    met:

    * Redistributions of source code must retain the above copyright notice,
    this list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

    * Neither the name "Markdown" nor the names of its contributors may be
    used to endorse or promote products derived from this software without
    specific prior written permission.

    This software is provided by the copyright holders and contributors "as
    is" and any express or implied warranties, including, but not limited
    to, the implied warranties of merchantability and fitness for a
    particular purpose are disclaimed. In no event shall the copyright owner
    or contributors be liable for any direct, indirect, incidental, special,
    exemplary, or consequential damages (including, but not limited to,
    procurement of substitute goods or services; loss of use, data, or
    profits; or business interruption) however caused and on any theory of
    liability, whether in contract, strict liability, or tort (including
    negligence or otherwise) arising in any way out of the use of this
    software, even if advised of the possibility of such damage.

multimarkdown's People

Contributors

fletcher avatar matthewrankin avatar mehaase 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  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

multimarkdown's Issues

blockquote syntax is ignored in the cells

Hello.

According to multimarkdown documentation:

You can use normal Markdown markup within the table cells.

but when i try this:

|col1 |col2 |
|:---|:---|
|>hello|blockquote|

i get this output (> is converted to &gt;):

col1 col2
>hello blockquote

(github does the same as multimarkdown)

is there any other way to indent content in table cells, or any chance this issue will get fixed?

Another problem with (Zotero-)BibTeX-keys

Hi, thank you for the very fast comments on the other issues.

I have one more. This file:
Title:
BibTeX: lit.bib
Copyright:
Keywords:
Format: complete
LaTeX XSLT: latex-snippet.xslt
Address: Foobar
Author: John Doe
Base Header Level: 3
Affiliation: University Schmersity
Email: [email protected]
Language: german
Phone:
Subtitle:
Web:
Format: complete

# Einleitung #

Welsch räumt in seinem Aufsatz auch eventuelle Einwände
gegen das Konzept, das eine Uniformierung erbringen könnte,
ein. Er geht darauf ein, dass die Vielheit in Form von
Einzelkulturen verschwinden wird.[^fn24] Ein neuer Typus von
Vielheit von Kulturen und Lebensformen würde in
transkulturellen Kombinationen entstehen.[^fn25]



[^fn23]: [71–79][#welsch_transkulturalitat._1997].

[^fn24]: [77][#welsch_transkulturalitat._1997] oder nur als
simulierte Eigenheit, in Form von Folklore vorkommen werden
[72][#welsch_transkulturalitat._1997].

[^fn25]: [78–79][#welsch_transkulturalitat._1997].

produces the following error, when run through mmd2LaTeX.pl:
-:42: parser error : Unescaped '<' not allowed in attributes values
d="fn:fn24">

(<a id="welsch_transkulturalitat.
^
-:42: parser error : attributes construct error
d="fn:fn24">

(<a id="welsch_transkulturalitat.
^
-:42: parser error : Couldn't find end of Start Tag a line 42
d="fn:fn24">

(<a id="welsch_transkulturalitat.
^
-:42: parser error : Opening and ending tag mismatch: em line 42 and a
(welsch_transkulturalitat.1997
^
-:42: parser error : Opening and ending tag mismatch: em line 42 and span
">welsch_transkulturalitat.1997, 77)

^
-:44: parser error : Unescaped '<' not allowed in attributes values
(wels
^
-:44: parser error : attributes construct error
(
wels
^
-:44: parser error : Couldn't find end of Start Tag a line 44
(
wels
^
-:44: parser error : Opening and ending tag mismatch: span line 44 and em
(
wels
^
-:44: parser error : Opening and ending tag mismatch: span line 42 and em
lass="externalcitation"> (
welsch

^
-:44: parser error : Opening and ending tag mismatch: p line 42 and a
a id="welsch
transkulturalitat._1997">welschtranskulturalitat._1997
^
-:44: parser error : Opening and ending tag mismatch: li line 42 and span
>welschtranskulturalitat._1997, 72)
^
-:44: parser error : Opening and ending tag mismatch: ol line 40 and p
ef:fn24" title="return to article" class="reversefootnote"> ↩


^
-:44: parser error : Opening and ending tag mismatch: div line 38 and li
n24" title="return to article" class="reversefootnote"> ↩

</li
^
-:48: parser error : Opening and ending tag mismatch: body line 10 and ol

^
-:49: parser error : Opening and ending tag mismatch: html line 5 and div

^
-:50: parser error : Extra content at the end of the document

^
unable to parse -
Oddly enough, other references to this item worked flawlessly throughout a larger file.

Mathjax and superscript notations collide

Specifying an equation like

\begin{equation}
    E = m c^2
\end{equation}

is valid Mathjax, but MultiMarkdown converts it to

\begin{equation}
    E = m c<sup>2</sup>
\end{equation}

which breaks the formatting of the equation.

Is there a way to disable the super-/subscript conversion in MultiMarkdown? Is disabling particular features possible?

Dependencies

What are the dependencies for MultiMarkdown? I get a load of command not found. I am guessing this needs pdfTeX, which needs tex. But that only builds 32-bit and needs a lot of patches. Anything else before I try and get this built? Will it work with MacTeX?

sh: pdflatex: command not found
sh: bibtex: command not found
sh: makeindex: command not found
sh: kpsewhich: command not found
sh: makeindex: command not found
sh: pdflatex: command not found
sh: pdflatex: command not found
sh: pdflatex: command not found
sh: pdflatex: command not found

Empty title ID declaration produces no ID

This could very well be an intentional feature, so feel free to dismiss it. I noticed that if a title is declared with an empty ID declaration, the h element acquires no ID at all. To me it would make more sense if the original ID generating mechanism produced an ID. Example:

 # Chapter Title [] #

Currently produces:

 <h1>Chapter Title</h1>

But could produce:

 <h1 id="chaptertitle">Chapter Title</h1>

Where the current behaviour creates a conflict is in the xhtml-toc.xslt. Any titles with empty ID declarations will result in duplicate entries, breaking the ToC linkages.

Exclude some metadata in html head

Hi,

I was wondering if there is a way to exclude some metadata items in the final rendered HTML.

For example I use the metadata transcludebase in order to incorporate my specific headers and footers.

So

transcludebase:   /Users/MyName/Dropbox/Sync/mmdStyles

renders:

<head>
    ...
    <meta name="transcludebase" content="/Users/MyName/Dropbox/Sync/mmdStyles"/>
    ...
</head>

But I do not want this metadata gets in the header. Is there a way to prevent this (not relevant information=> local and personal information)?

For example via

multimarkdown --exclude-in-header='transcludebase,other-meta'  changelog.md

regards,
Feek

metadata in yaml format

Is the metadata-front in a specific format? If not, I suggest making it a yaml front like github does with redcloth. It seems more uniform than returning strings and let the user do the parsing of e.g. category arrays manually.

What do you think?

Robin

HTML comments followed by text deleted in mmd2Latex

Given the source code below in Scrivener:
Some text....

<!-- 
\begin{table}[h]
\caption{Swanson's dimensions of maintenance}
\centering
\label{tbl:swanson}
\begin{tabular}{c|c}
[body of table]
\end{tabular}
\end{table} 
-->
We can shorten this table to identify the cause of change as either a) the system 
wasn’t       implemented properly; b) some assumption was incorrect; 
c) let’s improve the system.

That is, for a Latex table surrounded by HTML comments (to escape the Latex code), the mmd2latex.pl script will eat the text immediately following the close comment until it reaches a higher level heading. Doesn't happen with the raw MMD file nor the HTML parser.

Workaround is to insert a blank line between the two. Hard to track down.

Referring to the same footnote N times in a document prints it N consecutive times in the footnotes section

Test case also at Babelmark:

For most cases[^fn1], the procedure will produce sensible results.

[... later in the document ...]

In a few particular cases[^fn1], one should...

[... more of the document follows... ]

We have achieved satisfactory results for the general situation[^fn1].

## Footnotes

[^fn1]: there are a few exceptions: foos, bars, and bazes.

will produce the footnote repeated 3 times in the same location:

<p>For most cases<a href="#fn:fn1" id="fnref:fn1" class="footnote">1</a>, the procedure will produce sensible results.</p>

<p>[... later in the document ...]</p>

<p>In a few particular cases<a href="#fn:fn1" id="fnref:fn1" class="footnote">2</a>, one should...</p>

<p>[... more of the document follows... ]</p>

<p>We have achieved satisfactory results for the general situation<a href="#fn:fn1" id="fnref:fn1" class="footnote">3</a>.</p>

<h2 id="footnotes">Footnotes</h2>

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

<li id="fn:fn1"><p>there are a few exceptions: ...<a href="#fnref:fn1" class="reversefootnote">&#160;&#8617;</a></p></li>

<li id="fn:fn1"><p>there are a few exceptions: ...<a href="#fnref:fn1" class="reversefootnote">&#160;&#8617;</a></p></li>

<li id="fn:fn1"><p>there are a few exceptions: ...<a href="#fnref:fn1" class="reversefootnote">&#160;&#8617;</a></p></li>

</ol>
</div>

IMO, there should be only one occurrence of the footnote, preceded by backlinks to its references throughout the document. MediaWiki does just that.

Editor Based on MultiMarkDown

Hello,
Is there an editor with live preview (Something like StackEdit just Offline) which is based on MultiMarkDown and has all the features (Math + PDF Export)?

Thank You.

Beamer XSLT BibTex problems

Hi,
I am having problems with using the beamer xslt and Bibtex.
If I use "LaTeX XSLT: beamer ", I get the following error when running Bibtex:

This is BibTeX, Version 0.99c (Web2C 7.5.6)

I found no \bibdata command---while reading file scriv.aux

I found no \bibstyle command---while reading file scriv.aux

When I change the xslt to "LaTeX XSLT: article "
I get no such problem.

I notice that the beamer xslt does not append the

%   Bibliography
\bibliographystyle{\mybibliostyle}
\bibliocommand

Bit to the bottom of my document. I think it isn't being correctly matched in the XSLT, but I cannot work out exactly what the problem is.
Thanks!
Simon

How to specify table of contents

Bitbucket markdown will auto-generate with [TOC], but that doesn't work here. You mentioned something in the docs about using an XSLT to create it, but can you provide an example of the xslt and usage?

Add support for table cell wrapping to table_cleanup.pl

I noticed in the google group that it is possible to wrap table cells when converting MMD to PDF if you add a "+" symbol to the end of the column format string. But the table_cleanup.pl script unhelpfully removes this plus symbol. I have a patch to fix this behavior.

multimarkdown comments

One thing which both HTML and LaTeX allows is commenting. This is a useful feature when authoring longer pieces of text as it allows the author to make notes about the text. Is it possible? I've tried <!-- which doesn't work.

Different Markup Syntaxes

Ok, it's called MultiMarkDown and Markdown is great, but would it be feasible to configure additional syntax languages like textile? Some ideas issued in your ideas page are already possible with textile and wouldn't require you to build a large work around. Depending on the "complexity" of content the user could simply choose whether to use markdown as a simple and easy-to-read syntax or textile as one more-powerful, but also harder to learn. Just a thought. :)

Failure to copy support files on Windows

The mmd2PDF.pl and mmd2PDFXeLaTeX.pl files do not copy support files (.bib, *.png, *.gif, etc) to the temporary directory on Windows machines when generating PDF files.

I suspect this is an issue with Windows pathnames, spaces, quotes, an File::Glob. I've tried to test and debug, but wasn't having any luck and frankly got tired of dealing with it since I don't use Windows with any regularity...

Ideas, fixes, suggestions are welcome

Fails to Properly Parse Nested Definition Lists

MultiMarkdown fails to properly parse nested lists. Given this MultiMarkdown:

homepage

:   The official home of this project on the web.

bugtracker
:   This entry describes the bug tracking system for this distribution. It is
    a [Map](#Map) with the following valid keys:

    web
    :   a <a href="#URI">URI</a> pointing to a web front-end for the bug
        tracker

    mailto
    :   an email address to which bug reports can be sent

repository
:   This entry describes the source control repository for this distribution.
    It is a [Map](#Map) with the following valid keys:

    url
    :   a [URI](#URI) pointing to the repository itself

    we
    :   a [URI](#URI) pointing to a web front-end for the repository

    type
    :   a lowercase string indicating the VCS used

:   Because a URI like `http://myrepo.example.com/` is ambiguous as to type,
    producers should provide a `type` whenever a `url` key is given. The
    `type` field should be the name of the most common program used to work
    with the repository, e.g. git, svn, cvs, darcs, bzr or hg.

The output is:

<dl>
<dt>homepage</dt>
<dd>
<p>The official home of this project on the web.</p>
</dd>

<dt>bugtracker</dt>
<dd>
<p>This entry describes the bug tracking system for this distribution. It is
a <a href="#Map">Map</a> with the following valid keys:</p>
</dd>

</dl>

<pre><code>web
:   a &lt;a href="#URI"&gt;URI&lt;/a&gt; pointing to a web front-end for the bug
    tracker

mailto
:   an email address to which bug reports can be sent</code></pre>

<dl>
<dt>repository</dt>
<dd>
<p>This entry describes the source control repository for this distribution.
It is a <a href="#Map">Map</a> with the following valid keys:</p>
</dd>

</dl>

<pre><code>url
:   a [URI](#URI) pointing to the repository itself

we
:   a [URI](#URI) pointing to a web front-end for the repository

type
:&lt;dl&gt;</code></pre>

<p><dt>a lowercase string indicating the VCS used</dt>
<dd></p>

<p>Because a URI like <code>http://myrepo.example.com/</code> is ambiguous as to type,
producers should provide a <code>type</code> whenever a <code>url</code> key is given. The
<code>type</code> field should be the name of the most common program used to work
with the repository, e.g. git, svn, cvs, darcs, bzr or hg.</p>

<p></dd></p>

<p></dl></p>

Wow. Here's what it should be (output generated by peg-multimarkdown):

<dl>
<dt>homepage
</dt>
<dd>
<p>The official home of this project on the web.</p></dd>

<dt>bugtracker
</dt>
<dd>
<p>This entry describes the bug tracking system for this distribution. It is
 a <a href="#Map">Map</a> with the following valid keys:</p>
<dl>
<dt>web
</dt>
<dd>a <a href="#URI">URI</a> pointing to a web front-end for the bug
 tracker</dd>

<dt>mailto
</dt>
<dd>an email address to which bug reports can be sent</dd>
</dl>
</dd>

<dt>repository
</dt>
<dd>
<p>This entry describes the source control repository for this distribution.
 It is a <a href="#Map">Map</a> with the following valid keys:</p>
<dl>
<dt>url
</dt>
<dd>a <a href="#URI">URI</a> pointing to the repository itself</dd>

<dt>we
</dt>
<dd>a <a href="#URI">URI</a> pointing to a web front-end for the repository</dd>

<dt>type
</dt>
<dd>a lowercase string indicating the VCS used</dd>
</dl>
</dd>

<dd>
<p>Because a URI like <code>http://myrepo.example.com/</code> is ambiguous as to type,
 producers should provide a <code>type</code> whenever a <code>url</code> key is given. The
 <code>type</code> field should be the name of the most common program used to work
 with the repository, e.g. git, svn, cvs, darcs, bzr or hg.</p></dd>
</dl>

Since I rely on Text::MultiMarkdown from CPAN in my Perl apps (which is directly ported from here), I can't use peg-multimarkdown (yet!). So a fix for this issue in the Perl version would be appreciated.

Thanks!

David

mmd-manuscript-begin-doc no longer works in MMD4

If I use mmd-manuscript-begin-doc in place of mmd-memoir-begin-doc as a latex input in a very simple document, the resulting LaTeX output does not compile (using MacTeX 2013). Is manuscript no longer supported? Error messages below:

Processing: ./foo.tex

Document Class: memoir 2013/05/22 v3.7 configurable book, report, article document class

Latex Error: /usr/local/texlive/2013/texmf-dist/tex/latex/manuscript/manuscript.sty:66 Undefined control sequence.

Latex Error: /usr/local/texlive/2013/texmf-dist/tex/latex/manuscript/manuscript.sty:79 Undefined control sequence.

Latex Error: /usr/local/texlive/2013/texmf-dist/tex/latex/manuscript/manuscript.sty:84 Extra \else.

Latex Error: /usr/local/texlive/2013/texmf-dist/tex/latex/manuscript/manuscript.sty:90 Extra \fi.

Latex Error: /Users/fonnescj/.texmf/tex/latex/mmd/mmd-manuscript-begin-doc.tex:33 Undefined control sequence.

Latex Error: /Users/fonnescj/.texmf/tex/latex/mmd/mmd-manuscript-begin-doc.tex:34 Undefined control sequence.

Latex Error: /Users/fonnescj/.texmf/tex/latex/mmd/mmd-manuscript-begin-doc.tex:36 Undefined control sequence.

Latex Error: /Users/fonnescj/.texmf/tex/latex/mmd/mmd-manuscript-begin-doc.tex:40 Undefined control sequence.

Latex Error: /Users/fonnescj/.texmf/tex/latex/mmd/mmd-manuscript-begin-doc.tex:62 Font \body="Courier New" at 12.0pt not loadable: Metric (TFM) file not found.

pdfTeX warning (ext4): destination with the same identifier (name{page.1}) has been already used, duplicate ignored

LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.

(see the transcript file for additional information)pdfTeX warning (dest): name{section.1.1} has been referenced but does not exist, replaced by a fixed one

pdfTeX warning (dest): name{section*.1} has been referenced but does not exist, replaced by a fixed one

Only the first foot note is correctly marked.

The following snippet:

 This is the first footnote.[^note1] Here's some text.

 This is the second footnote.[^note2] Here's some other text.

 This is the third footnote.[^note3]  Here's some other text again.

 This is the fourth footnote.[^note4]  Here's some other text many more times.

[^note1]: Hello.
[^note2]: World.
[^note3]: See you later.
[^note4]: Good bye.

produces only the first footnote correctly interpreted, and the rest show up uninterpreted as:

1. Hello. [^note2]: World. [^note3]: See you later. [^note4]: Good bye.  ↩

What am I doing wrong?

Markdown Inside HTML Blocks

When doing a complex page sometimes I want to wrap a "

" around a piece of multimarkdown. AFAICT, there is no way to do this in multimarkdown since the insides of block-level html elements are not formatted and there is no multimarkdown syntax for "div".

Could you add support for formatting multimarkdown inside bock-level elements? For example, something like what markdown extra does http://michelf.com/projects/php-markdown/extra/#markdown-attr (I'm not attached to their particular rules).

Wrong number used in LaTeX for figure and tables references

At times when referencing a LaTeX figure, using the MMD command [](#ref_foo), will reference the wrong number. The problem appears to be that the \label{} code in xhtml2latex.xslt comes before the \caption{} code. To solve, I recommend moving the \label{} code to be inside the \caption{} code, such as \caption{\label{ref_foo} Caption for the Figure}.

Update XSLTs to use 'glossaries' package, which has replaced 'glossary'

It seems as if the standard 'glossary' package has now been replaced by the 'glossaries' package, which makes a number of changes to the way that entries are defined: http://www.latex-community.org/index.php?option=com_content&view=article&id=263%3Aglossaries-nomenclature-lists-of-symbols-and-acronyms&catid=55%3Alatex-general&Itemid=112

in particular, where \glossary{term}{definition} is used in the old package (and XSLT), the more complex
\newglossaryentry{term}{name=term,description={definition}} seems to be mandated. It can then be referenced using \gls{term} (or variations).

I've had a look at the xhtml2latex XSLT, but altering it is beyond my capabilities...

Footnote references must be treated as paragraphs

I'm not sure if this is a feature or a bug…

When using links in reference-style, list mode, each link only needs to be separated by one newline, like so:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna[^2] aliqua. Ut enim ad minim [veniam][test1], quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla [pariatur][test2]. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

[test1]: www.example1.com
[test2]: www.example2.com

However, when using footnotes, which follow a similar markup pattern, each footnote needs to be separated by a blank line, otherwise all footnotes are grouped together in the same note when converted to HTML. For example, in this paragraph

Lorem ipsum[^1] [dolor][test3] sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna[^2] aliqua. Ut enim ad minim [veniam][test1], quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla [pariatur][test2]. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

This reference list fails and includes both the second footnote and the third link in the text of the first:

[test1]: www.example1.com
[test2]: www.example2.com
[^1]: This is a footnote  
[^2]: This is another footnote
[test3]: www.example3.com

Where as this doesn't fail and works correctly:

[test1]: www.example1.com
[test2]: www.example2.com

[^1]: This is a footnote 

[^2]: This is another footnote

[test3]: www.example3.com

I understand that footnotes are a special case (that don't actually exist in real HTML), and that you can expectedly have multiple paragraphs or other HTML elements in a footnote definition (while you can only have a URL and an optional title in link definitions)

Would it be possible in the footnote parsing functions, though, to remove the need for the newlines, perhaps by checking for a [^x]:, since it shouldn't be possible to include a footnote inside a footnote. It would make the reference-style footnotes act more like the reference-style links and save a lot of unnecessary whitespace.

Problem with (Zotero-)BibTeX-keys

Zotero (http://www.zotero.org) constructs BibTeX-keys like this:

[name]_[first word of title]_[year]

Consequently, BibTeX-keys of works without author are exported by Zotero beginning with an underscore. This results in MultiMarkdown-citations like this one:

[][#_frei_2009]

These don't go down well with the parser. When trying to convert them to LaTeX, they produce errors like these (thrown by the MultiMarkdown-version included with Scrivener 2.0.2):

-:502: parser error : Unescaped '<' not allowed in attributes values
<li id="fn:fn40"><p><span class="externalcitation"> (<a id="<em>frei</em>2009"><
                                                            ^
-:502: parser error : attributes construct error
<li id="fn:fn40"><p><span class="externalcitation"> (<a id="<em>frei</em>2009"><
                                                            ^
-:502: parser error : Couldn't find end of Start Tag a line 502
<li id="fn:fn40"><p><span class="externalcitation"> (<a id="<em>frei</em>2009"><
                                                            ^
-:502: parser error : Opening and ending tag mismatch: span line 502 and a
<span class="externalcitation"> (<a id="<em>frei</em>2009"><em>frei</em>2009</a>
                                                                               ^
-:502: parser error : Opening and ending tag mismatch: p line 502 and span
ass="externalcitation"> (<a id="<em>frei</em>2009"><em>frei</em>2009</a>)</span>
                                                                               ^
-:502: parser error : Opening and ending tag mismatch: li line 502 and p
ef:fn40" title="return to article" class="reversefootnote">&#160;&#8617;</a></p>
                                                                               ^
-:502: parser error : Opening and ending tag mismatch: ol line 422 and li
n40" title="return to article" class="reversefootnote">&#160;&#8617;</a></p></li
                                                                               ^
-:504: parser error : Opening and ending tag mismatch: div line 420 and ol
</ol>
     ^
-:505: parser error : Opening and ending tag mismatch: body line 27 and div
</div>
      ^
-:506: parser error : Opening and ending tag mismatch: html line 5 and body
</body>
       ^
-:507: parser error : Extra content at the end of the document
</html>
^
unable to parse -

Could these be fixed? Or does the Zotero BibTeX-translator have to be modified? I don't think a BibTeX-key starting with an underscore («_») is invalid, though.

Multicolumn cells don't follow the alignment rules in Latex

A long cell

| heading | heading | heading |
|--------:|:--------|:--------|
| cell    |   **long cell**   |

will export latex code to align the long cell text to the center instead of to the left.

&cell&\multicolumn{2}{c}{\textbf{long cell}}\\

should be:

&cell&\multicolumn{2}{l}{\textbf{long cell}}\\

RTL?

Can I write rtl direction in MultiMarkdown? (Ex: for writing arabic letter)
Thanks :)

emacs tables

Hi! First, let me thank you for this : ). It works really well, and it's a lot faster than Pandoc.

Editing tables by hand is a pain; I've learnt to use some of Emacs just to help with that. I guess Emacs tables should be parsed as well... as there is no other good text-only table editor around.

Improperly includes closing tag when parsing text inside HTML tags

To see this improper behavior in action, run the following in the Terminal (assuming that you have switched to a directory containing the multimarkdown binary):

echo "<div markdown=\"1\">
# Example

Paragraph wraps closing div tag:
</div>" | ./multimarkdown

The output I expect is this:

<div>
<h1 id="example">Example</h1>

<p>Paragraph wraps closing div tag:</p>
</div>

But the output that I get is this:

<div>

<h1 id="example">Example</h1>

<p>Paragraph wraps closing div tag:
</div></p>

The same problem exists for parsing lists that abut the end tag, except the closing tag gets wrapped by both the last LI and the UL. Adding an extra linebreak between the paragraph and the closing tag results in the paragraph/list being closed properly, but then the closing tag is wrapped in its own paragraph:

<p></div></p>

Ideally, MultiMarkdown should treat everything between the opening and closing tag of a tag with markdown="1" as a standalone document snippet and completely ignore the tags themselves.

cat not a recognized command in Windows

The mmd scripts don't work on Windows due to cat not being a recognized command in Windows. This line:

unless (my $return = eval `cat "$file"`) {

causes this error:

'cat' is not recognized as an internal or external command,
operable program or batch file.
couldn't do C:/Program Files/MultiMarkdown/bin/MultiMarkdown/Support.pm:  
at C:\Program Files\MultiMarkdown\bin\mmd2XHTML.pl line 153.
couldn't run C:/Program Files/MultiMarkdown/bin/MultiMarkdown/Support.pm 
at C:\Program Files\MultiMarkdown\bin\mmd2XHTML.pl line 154.

Bug: First line becomes metadata (mmd2XHTML)

A minor bug. If there is no metadata, converting a markdown file to XHTML appends the first line of text to the <meta name="Format" content="complete" /> tag and strips it from the body.

E.g.: a file containing Hello World! will be formatted as:

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <!-- Processed by MultiMarkdown -->
        <meta name="Format" content="complete
Hello World!" />
    </head>
<body>


</body>
</html>

CSS file relative path

It would be best if the relative path of the CSS file mentioned in the metadata is relative to the input file (i.e. Markdown file) instead of the output file (i.e. HTML file).

This would make it easier to chain this program with other programs.
I am specifically concerned with this issue -
swaroopch/vim-markdown-preview#6

mmd2PDF.pl complains about missing images

When running mmd2PDF.pl on my file it complains about not finding the images used in the document. HTML output is fine. Also if I run pdflatex manually on the created .tex file the pdf compiles just fine.
Perhaps its just me, but I have no possibility to test on another system.
If you need more info, please feel free to ask.

I'm on SnowLeopard with TexLive

Chapterstyle and pagestyle not set when using article.xslt

When article.xslt is selected, the chapterstyle and pagestyle metadata settings are ignored.

Since the article.xslt uses the memoir class, as opposed to the LaTeX article class, it would be nice for the chapterstyle and pagestyle metadata settings to be honored—or at least the pagestyle setting so that the headers can be customized.

I plan to create a branch from the most recent commit, f3f91b2, and add the following two lines just after the \begin{document} line in article.xslt:

\chapterstyle{\mychapterstyle}
\pagestyle{\mypagestyle}

MultiMarkdown appears to have issue with TexLive2008

Trying to use mmd2PDFXeLaTeX.pl basic.mmd causes a stop for input inside xelatex (or latex if the other script is used.

 (/usr/local/texlive/2008/texmf/tex/latex/config/color.cfg))
 ! Missing \endcsname inserted.

Here is a small basic.mmd

 Title: Test 
 Author: David Green  
 Date: 07 September 2009  
 Format: complete  
 LaTex xslt: article  
 Base Header Level: 2  

 Task - Model a Digital Logic
 ============================

 The purpose of this program is to model some simple digital logic --
 a register and a counter.

Citation documentation

A suggested clarification for citations in the MultiMarkdown documentation. This:

You are not required to use a locator (e.g. p. 23), and there are
no special rules on what can be used as a locator if you choose
to use one.

To this:

You are not required to use a locator (e.g. p. 23), and there are
no special rules on what can be used as a locator if you choose
to use one. If you prefer to omit the locator, just use an empty
set of square brackets before the citation:

    This is a statement that should be attributed to its 
    source[][#Doe:2006].

specify metadata at CLI

I'd love to be able to specify metadata (like css) on the command line, rather than in the doc.

Add possibility to make frames.

There wille be cool if you can implement a way to make frames (not like html frames but like a square with a border) present a thing or an equation result.

Inline footnotes and line breaks

I'm not sure if this is a bug or it's by design, but inline footnotes are not taken to be footnotes when there is a hard linebreak in the text. For example:

some text [^this is a footnote]

more text [^this is
not]

It's advised in the syntax guide to experiment with the footnote syntax and report border cases, so I'm doing that here.

Fails to correctly render footnotes in image titles

I have the following image with a caption and a footnote in its caption:

![Figure 1: Useful technology for the present and the future.[^fn-figure_1]](/image/path)

[^fn-figure_1]: *Big data, Analytics and the Path from Insights to Value*, MIT Solan management review, Winter 2011.

The above code doesn't work. Prints out:

<figure>
<img src="" alt="Figure 1: Useful technology for the present and the future.*Big data, Analytics and the Path from Insights to Value*, MIT Solan management review, Winter 2011.

fn-figure_1" />
<figcaption>Figure 1: Useful technology for the present and the future.<a href="#fn:*Big data, Analytics and the Path from Insights to Value*, MIT Solan management review, Winter 2011.

" title="see footnote" class="footnote">[*Big data, Analytics and the Path from Insights to Value*, MIT Solan management review, Winter 2011.

]</a></figcaption></figure>

I also tried wrapping image caption as a link:

![[Figure 1: Useful technology for the present and the future.][^fn-figure_1]](/image/path)

[^fn-figure_1]: *Big data, Analytics and the Path from Insights to Value*, MIT Solan management review, Winter 2011.

But it doesn't seem to work either. Outputs:

<p>![[Figure 1: Useful technology for the present and the future.]<a href="#fn:1" id="fnref:1" title="see footnote" class="footnote">[1]</a>]()</p>

extended attributes do not work with numeric reference links

If you have a reference link of the form

[my label][1]

and extended attributes:

[1]: http://example.com/ "title here" class=myclass

Where the link id is entirely numeric ("1" above).

Then the extended attributes are ignored. This is because Header2Label strips off leading numerics from the link id, leaving it blank, so _DoAttributes is called with blank instead of the proper link id.

Workaround is to add a leading non-numeric character to the link id. Is there a reason for Header2Label not to allow leading numerics?

-Jason

sffms.xslt uses underline instead of emph

The XSLT is using the \underline command instead of the recommended \emph command. The main issue with underline (which is the same in most LaTeX cases), is that it easily overfills the hbox, causing long emphasised passages to run off the edge of the page. Switching the XSLT to \emph sorted this right out. Proposed code:

<xsl:template match="html:em">
    <xsl:text>\emph{</xsl:text>
    <xsl:apply-templates select="node()"/>
    <xsl:text>}</xsl:text>
</xsl:template>

This will also keep emphasis semantic, since sffms can be toggled into non-submission mode, where italics are used as normal instead of underlining.

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.