Keep track if a link or footnote was deferred. This makes it possible to
do this again when generating (formatted) markdown output. I.e. now all
deferred links/footnotes become inline because it does not know that
some of them had been deferred.
Without this patch:
Footnote^[footnote *with* stuff ]
With this patch:
Footnote[^id]
[^id]: footnote *with* stuff
Where the later is how to the original markdown file was formatted.
Signed-off-by: Miek Gieben <miek@miek.nl>
mmark 2 promised to implement this: allow a citation suffix:
[@!RFC1034, p. 144]. Implement this by splitting on the comma.
Add multiple tests for this new behavior.
Signed-off-by: Miek Gieben <miek@miek.nl>
A user pinged me that is was apparently possible w/ mmark1 and it has
some kind of elegance to bring it back to mmark2.
Signed-off-by: Miek Gieben <miek@miek.nl>
This adds an (empty) *ast.Footnote before the footnotes are added.
This can be used to customize the it, i.e. putting it in a new section.
The HR output is put behind a flag html.FootnoteNoHRTag to suppress that
as well.
Signed-off-by: Miek Gieben <miek@miek.nl>
Other markdown parser put this behind an extension; do the same here:
extension: SuperSubscript.
Detect sequences between ^ and ~ as super and subscript respectively.
Signed-off-by: Miek Gieben <miek@miek.nl>
Update the README with table footer syntax: fixes#77
Update the README and just point to mmark.nl instead of listing
all mmark syntax elements (again).
Fix multiple classes in headers.
Make header.Special a bool and rename it it IsSpecial.
Signed-off-by: Miek Gieben <miek@miek.nl>
This takes the syntax from kramdown: https://kramdown.gettalong.org/syntax.html#tables
Rename tableHead to tableHeader, and use tableFooter for consistency.
It's not guarded by any parser extension, except parser.Tables
Signed-off-by: Miek Gieben <miek@miek.nl>
To allow linking to indices by giving them an ID; without it an index
can not refer back to the actual index item from main index at the end
of the document.
Signed-off-by: Miek Gieben <miek@miek.nl>
This parsed (!item) as an index, subitems are allowed as well as making
the index primary (by adding another !: (!!item). The HTML output is
non-existent and there is no go in gomarkdown to render an index (left
to a custom renderer)
Signed-off-by: Miek Gieben <miek@miek.nl>
Add ast.Callout node that is detected in test and extra utils to parse
it in codeblock.
See https://mmark.nl/post/syntax/#callouts for what they are.
Signed-off-by: Miek Gieben <miek@miek.nl>
Implement the TODO and a method `String()` that returns a string for
AlignmentFlags.
Pondered doing the same for Matters and CitationTypes, but those are
more renderer dependent (and not standard).
Signed-off-by: Miek Gieben <miek@miek.nl>
This adds Mmark support for captions under quotes block or fenced code
blocks. This can be used by adding: `Caption: <text>` under the block.
All text up to the next empty line is read.
This adds ast.Caption, which is a noop in the html/renderer because the
elements need to walk this node outside of the main ast. The node can
only hold span elements (p.inline()).
Signed-off-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Miek Gieben <miek@miek.nl>
Implement document divisions
front/main/back-matter. There is no html equivalent of these.
Signed-off-by: Miek Gieben <miek@miek.nl>
This implements asides, blockquote like paragraph prexifed with `A>`
instead of just a '>'
Adds the extension MmarkAsides
Signed-off-by: Miek Gieben <miek@miek.nl>
This adds detection for headers that start with `.#`. It adds the Mmark
extension, update the mmar test, adds some documentation.
I'm reusing the ast.Heading to have a maximum amount of code re-use.
Signed-off-by: Miek Gieben <miek@miek.nl>
This keeps track of the starting number of an ordered list and uses it
when not zero. Fails the tests so it will probably have to wait until
we have the Mmark extension merged.
Signed-off-by: Miek Gieben <miek@miek.nl>
This adds the possibility to add block level attributes:
{#id2}
> line
When enabled to will generate (for HTML) an id="id2" in the openening
tag of the block quote:
<blockquote id="id2">
<p>line</p>
</blockquote>
Only one block level attribute is allowed, if multiple are given only
the last one seen is applied, the rest is silently ignored.
The attributes are stored in *Parser and copied to the node in addBlock.
It's up to the renderer to use the attributes, the html renderer
currently applies them to most block level elements.
Signed-off-by: Miek Gieben <miek@miek.nl>