Commit Graph

840 Commits

Author SHA1 Message Date
Miek Gieben d43e795e3e
Merge pull request #62 from mmarkdown/attributes
Set attributes for block element captionFigure
2018-08-15 17:21:24 +01:00
Miek Gieben 9630e6c87e
Merge pull request #61 from mmarkdown/index-tracking
Add uniq ID to indices
2018-08-15 18:17:49 +02:00
Miek Gieben 0d24865f76 Set attributes for block element captionFigure
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-15 17:09:35 +01:00
Miek Gieben 744eed10c1 just make it an int
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-15 16:48:04 +02:00
Miek Gieben a4a196b482 Add uniq ID to indices
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>
2018-08-15 16:32:06 +02:00
Miek Gieben 55ca3c7e06
Merge pull request #60 from mmarkdown/whitespacehack
Mark tests: remove whitespace hack
2018-08-15 15:21:49 +01:00
Miek Gieben 7649852468
Merge pull request #59 from mmarkdown/cross-ref
parser: cross ref: fix
2018-08-15 15:21:16 +01:00
Miek Gieben cb658cd24f Mark tests: remove whitespace hack
Doesn't add anything and actually created testcases that were wrong.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-15 16:06:25 +02:00
Miek Gieben b360c9efea parser: cross ref: fix
Fix the parsing and add a testcase in testdata/mmark.test

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-15 16:03:59 +02:00
Miek Gieben f5568e358d
Merge pull request #55 from mmarkdown/index-example-list
parser: allow indices
2018-08-13 20:35:28 +01:00
Miek Gieben 699609b6d8 parser: allow indices
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>
2018-08-13 19:21:00 +02:00
Miek Gieben 43dafbfdad
Merge pull request #53 from mmarkdown/include-cleanup
Include cleanup
2018-08-13 08:14:37 +01:00
Miek Gieben 7b5ce305f4 parser,include: remove updateWd as well
Remove updateWd as well, and advance the data to the consumed
bytes otherwise we're are re-reading the data.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-13 09:04:24 +02:00
Miek Gieben e246916f22 Remove all cwd related functions
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-12 21:40:39 +01:00
Miek Gieben 560804f06c
Merge pull request #51 from mmarkdown/include-head-bytes
html: Allow additional head bytes to be injected
2018-08-12 21:22:11 +01:00
Miek Gieben 0b8349a632
Merge pull request #52 from mmarkdown/include2
parser: remove logic to keep cwd
2018-08-12 21:21:58 +01:00
Miek Gieben 3d381cc496 parser: remove logic to keep cwd
This removes the logic for CWD tracking and leaves it up to the user
of the library to do this themselves.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-11 11:14:48 +01:00
Miek Gieben f2d8c9a57d html: Allow additional head bytes to be injected
Allows one to add more head tags, mostly scripts usually, to be included
in the <HEAD> section of the generated HTML. This keeps the doc self
contained.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-11 11:04:43 +01:00
Krzysztof Kowalczyk 83813889a6 maybe stop codecov complaining about not enough coverage 2018-08-10 14:43:34 -07:00
Miek Gieben dfd1eb5426
Merge pull request #48 from mmarkdown/callouts
Add callout parsing
2018-08-10 22:34:22 +01:00
Krzysztof Kowalczyk 9f2eaaf716 maybe fix building PRs in travis 2018-08-10 14:29:04 -07:00
Miek Gieben 9f9e0e833b correct import
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-10 22:23:04 +01:00
Miek Gieben 45707013cb Add callout parsing
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>
2018-08-10 22:03:41 +01:00
Miek Gieben d7aac2d895
Merge pull request #47 from mmarkdown/caption-quote
Add quote block even without caption
2018-08-09 19:39:06 +01:00
Miek Gieben 0d628773de Add quote block even without caption
This is the same fix as for #40, but for quote block.

Add bare quote test to testdata/mmark.test as well for this.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-09 16:57:32 +01:00
Miek Gieben 8d3d356b04
Merge pull request #46 from mmarkdown/code-include
Code include
2018-08-08 21:25:02 +01:00
Miek Gieben a2492adee6 Call correct method in the test
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-08 21:19:26 +01:00
Miek Gieben 637a45dd3f Add codeinclude test
Add test for code include <{{..}}. And Fix off-by-one error if we
process a code include.

Also set the language if we have a code include.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-08 21:12:21 +01:00
Miek Gieben 0ba528595b Merge branch 'master' of github.com:gomarkdown/markdown into code-include 2018-08-08 21:08:29 +01:00
Miek Gieben 8f3c480f3e Fix code include
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-08 21:08:25 +01:00
Miek Gieben 12d7bbfc62
Merge pull request #45 from mmarkdown/include-tests
Fix include testing
2018-08-08 20:51:06 +01:00
Miek Gieben 001fb50675 Fix include testing
Make the test table driven and fix bugs uncovered by the new test.
Mainly in the area of parsing the optional address specification between
block quotes.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-08 20:17:13 +01:00
Miek Gieben 67424e3cca
Merge pull request #44 from mmarkdown/include-off-by-one
Fix off-by-one error in include parsing
2018-08-07 22:56:53 +01:00
Miek Gieben f843493451 Fix off-by-one error in include parsing
Of course, this happened. Fix off-by-one

Caught by mmark testing

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-07 22:32:07 +01:00
Miek Gieben c67f36651c
Merge pull request #43 from mmarkdown/include-address
Fix include's address specification
2018-08-07 21:25:42 +01:00
Miek Gieben 074b4fa373 Fix include's address specification
Fixes #10

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-07 20:46:42 +01:00
Miek Gieben 01a56b20f8
Merge pull request #42 from mmarkdown/align-string
Make a String() function for AlignmentFlags
2018-08-07 07:54:34 +01:00
Miek Gieben 543ba837f9 Make a String() function for AlignmentFlags
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>
2018-08-07 07:43:02 +01:00
Miek Gieben 3b95c4fb8e
Merge pull request #41 from mmarkdown/classes
Fix how classes are returned in block level attributes
2018-08-06 23:48:10 +01:00
Miek Gieben 31666d246c Add test
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-06 23:32:08 +01:00
Miek Gieben 7e6b680d17 Fix how classes are returned in block level attributes
Also export it, so it can be used directly in mmark/xml/renderer.go (I
had the exact copy of this code there)

Fixes #27

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-06 23:03:09 +01:00
Miek Gieben 73dfd3c13e
Merge pull request #40 from mmarkdown/mmark-add-block
Add block for Mmark
2018-08-06 20:45:42 +01:00
Miek Gieben 11c226f8ae Add block for Mmark
If the mmark extension is set and there is no caption we should still
add the block to the AST.

Caught by mmark testing.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-06 20:35:47 +01:00
Miek Gieben 566d53aee4
Merge pull request #39 from mmarkdown/export-inline
Export parser.Inline
2018-08-05 20:44:07 +01:00
Krzysztof Kowalczyk 7462de8d99 tweak comment 2018-08-05 11:37:51 -07:00
Krzysztof Kowalczyk de14329a8f remove unused function 2018-08-05 11:34:53 -07:00
Miek Gieben 97814d992e Export parser.Inline
Make this public so other renderers/parser can call p.Inline.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-05 18:25:27 +01:00
Miek Gieben f4c71355db
Merge pull request #34 from mmarkdown/include-hook
Support includes
2018-08-04 08:45:47 +01:00
Miek Gieben db4c2c1320
Merge pull request #33 from mmarkdown/citations
Citations
2018-08-03 19:14:36 +01:00
Miek Gieben a159f9c632 Naming and tests
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-03 19:13:12 +01:00