From e6b11f0c24dacb79490e35c6b56e6400542a3497 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Thu, 10 Oct 2019 07:43:04 +0100 Subject: [PATCH] Remove xml2 renderer (#97) RFC 7749 is deprecated, remove renderer, assorted test files and documentation. The -2 switch is removed as well, making this a breaking change for folks depending on it. Signed-off-by: Miek Gieben --- README.md | 18 +- Syntax.md | 55 +- mmark.1.md | 21 +- mmark.go | 12 - mmark_test.go | 25 - render/xml2/bibliography.go | 66 --- render/xml2/helpers.go | 130 ----- render/xml2/renderer.go | 893 --------------------------------- render/xml2/title.go | 88 ---- testdata/2/abstract.md | 3 - testdata/2/abstract.xml | 2 - testdata/2/anchor.md | 5 - testdata/2/anchor.xml | 4 - testdata/2/caption-escape.md | 4 - testdata/2/caption-escape.xml | 4 - testdata/2/caption-id.md | 5 - testdata/2/caption-id.xml | 12 - testdata/2/codeblock.md | 3 - testdata/2/codeblock.xml | 2 - testdata/2/em.md | 1 - testdata/2/em.xml | 1 - testdata/2/hangtext.md | 5 - testdata/2/hangtext.xml | 8 - testdata/2/header-escape.md | 1 - testdata/2/header-escape.xml | 2 - testdata/2/header.md | 1 - testdata/2/header.xml | 2 - testdata/2/hr.md | 3 - testdata/2/hr.xml | 3 - testdata/2/images.md | 5 - testdata/2/images.xml | 9 - testdata/2/list-in-list.md | 5 - testdata/2/list-in-list.xml | 11 - testdata/2/list-paragraphs.md | 6 - testdata/2/list-paragraphs.xml | 9 - testdata/2/quote-in-list.md | 8 - testdata/2/quote-in-list.xml | 12 - testdata/2/sections.md | 9 - testdata/2/sections.xml | 10 - testdata/2/table-align.md | 5 - testdata/2/table-align.xml | 12 - testdata/2/table-caption.md | 10 - testdata/2/table-caption.xml | 22 - testdata/2/table-em.md | 4 - testdata/2/table-em.xml | 12 - testdata/2/table.md | 5 - testdata/2/table.xml | 12 - 47 files changed, 14 insertions(+), 1531 deletions(-) delete mode 100644 render/xml2/bibliography.go delete mode 100644 render/xml2/helpers.go delete mode 100644 render/xml2/renderer.go delete mode 100644 render/xml2/title.go delete mode 100644 testdata/2/abstract.md delete mode 100644 testdata/2/abstract.xml delete mode 100644 testdata/2/anchor.md delete mode 100644 testdata/2/anchor.xml delete mode 100644 testdata/2/caption-escape.md delete mode 100644 testdata/2/caption-escape.xml delete mode 100644 testdata/2/caption-id.md delete mode 100644 testdata/2/caption-id.xml delete mode 100644 testdata/2/codeblock.md delete mode 100644 testdata/2/codeblock.xml delete mode 100644 testdata/2/em.md delete mode 100644 testdata/2/em.xml delete mode 100644 testdata/2/hangtext.md delete mode 100644 testdata/2/hangtext.xml delete mode 100644 testdata/2/header-escape.md delete mode 100644 testdata/2/header-escape.xml delete mode 100644 testdata/2/header.md delete mode 100644 testdata/2/header.xml delete mode 100644 testdata/2/hr.md delete mode 100644 testdata/2/hr.xml delete mode 100644 testdata/2/images.md delete mode 100644 testdata/2/images.xml delete mode 100644 testdata/2/list-in-list.md delete mode 100644 testdata/2/list-in-list.xml delete mode 100644 testdata/2/list-paragraphs.md delete mode 100644 testdata/2/list-paragraphs.xml delete mode 100644 testdata/2/quote-in-list.md delete mode 100644 testdata/2/quote-in-list.xml delete mode 100644 testdata/2/sections.md delete mode 100644 testdata/2/sections.xml delete mode 100644 testdata/2/table-align.md delete mode 100644 testdata/2/table-align.xml delete mode 100644 testdata/2/table-caption.md delete mode 100644 testdata/2/table-caption.xml delete mode 100644 testdata/2/table-em.md delete mode 100644 testdata/2/table-em.xml delete mode 100644 testdata/2/table.md delete mode 100644 testdata/2/table.xml diff --git a/README.md b/README.md index 148362e..50e92b2 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ write RFC using Markdown. It provides an advanced markdown dialect that processes file(s) to produce internet-drafts in XML [RFC 7991](https://tools.ietf.org/html/rfc7991) format. Mmark can produce xml2rfc (aforementioned -RFC 7991), RFC 7749 (xml2rfc version 2), HTML5 output, markdown and manual pages. +RFC 7991), RFC 7749 (xml2rfc version 2 - now deprecated), HTML5 output, markdown and manual pages. Example RFCs in Mmark format can be [found in the Github repository](https://github.com/mmarkdown/mmark/tree/master/rfc). @@ -74,14 +74,8 @@ Making a draft in text form (v3 output) % ./mmark rfc/3514.md > x.xml % xml2rfc --v3 --text x.xml -Making a draft in text form (v2 output) - - % ./mmark -2 rfc/3514.md > x.xml - % xml2rfc --text x.xml - -Outputting HTML5 is done with the `-html` switch. Outputting RFC 7749 is done with `-2`. And -outputting markdown is done with the `-markdown` switch (optionally you can use `-width` to set the -text width). +Outputting HTML5 is done with the `-html` switch. Outputting markdown is done with the `-markdown` +switch (optionally you can use `-width` to set the text width). [1]: https://daringfireball.net/projects/markdown/ "Markdown" [2]: https://golang.org/ "Go Language" @@ -96,12 +90,6 @@ cd rfc make txt ~~~ -For v2 (i.e. the current (2018) way of making RFC), just run: -~~~ sh -cd rfc -make TWO="yes" txt -~~~ - Official RFCs are in rfc/orig (so you can compare the text output from mmark). ## Using Mmark as a library diff --git a/Syntax.md b/Syntax.md index cad490b..a8499ed 100644 --- a/Syntax.md +++ b/Syntax.md @@ -28,9 +28,9 @@ Biggest changes: It fixes a bunch of long standing bugs and the parser generates an abstract syntax tree (AST). It will be easier to add new renderers with this setup. It is also closer to Common Mark. So we took -this opportunity to support RFC 7991 XML (xml2rfc version 3), HTML5, RFC 7749 XML (xml2rfc -version 2) and Markdown output (use mmark is a markdown formatter). Also with code upstreamed (to -[gomarkdown](https://github.com/gomarkdown)), we have less code to maintain. +this opportunity to support RFC 7991 XML (xml2rfc version 3), HTML5, RFC 7749 XML (xml2rfc version 2 +- now deprecated) and Markdown output (use mmark is a markdown formatter). Also with code upstreamed +(to [gomarkdown](https://github.com/gomarkdown)), we have less code to maintain. Because of the abstract syntax tree it will also be easier to write helper tools, like, for instance a tool that checks if all referenced labels in the document are actually defined. Another idea could @@ -185,50 +185,7 @@ Comments: ### XML RFC 7749 Output When the RFC editor drops support for this format it will be removed from Mmark as well. This is -expected to happen in 2019. - -Title Block: -: Identical to RFC 7991, Mmark will take care to translate this into something xml2rfc (v2) can - understand. An Mmark document will generate valid RFC 7991 and 7749 XML, unless [block - level attributes](#block-level-attributes) are used that are speficic to each format. - *Area* defaults to "Internet" and *Ipr* defaults to `trust200902`. - - Not giving a date will output `` which mean the current date will be applied *when - xml2rfc is run*. - -BCP 14/RFC 2119 Keywords: -: If an RFC 2119 word is found enclosed in `**` it will be rendered normally i.e. `**MUST**` - becomes `MUST`. - -Artwork/Source code: -: There is no such distinction so these will be rendered in the same way regardless. If you need a - caption you can just give it one. If you want the *final* output to prefix `Figure N` or `Table - N` is **also** needs to have an anchor; this is done with a block level attribute: `{#figX}`. If - you *only* want `Figure N`, only give it an anchor. - -Block Level Attributes: -: We use the attributes as specified in RFC 7749, e.g. to speficify an empty list style use: - `{style="empty"}` before the list. Any attributes that are not allowed are filtered out, so - `{style="empty" empty="true"}`, will make a document both RFC 7749 and RFC 7991 compliant. - -Asides: -: Basically not supported, will be rendered as a plain paragraph. - -Footnotes: -: Are discarded from the final output, don't use them. - -Images: -: Images are not supported and we fake an artwork with some of the meta date. Using the example from - RFC 7991 output would just yields: `img.jpg "alt" "title"`. - -Block quote: -: Supported by faking an list with style empty. - -Horizontal Line: -: Outputs a paragraph with 60 dashes `-`. - -Comments: -: HTML comments are detected and discarded. +expected to happen in 2019. This has been implemented in October 2019. ### HTML5 Output @@ -632,9 +589,7 @@ detected by Mmark. ### BCP14 Phrases that are defined in RFC 2119 (i.e. MUST, SHOULD, etc) are detected when being type set as -strong elements: `**MUST**`, in the RFC 7991 output these will typeset as `MUST`. In -RFC 7749 output it will just be `MUST`. Not that these can't span lines, e.g., `**MUST NOT**`, must -be on a single line. +strong elements: `**MUST**`, in the RFC 7991 output these will typeset as `MUST`. # Changes from version 1 diff --git a/mmark.1.md b/mmark.1.md index 5da9e88..2054796 100644 --- a/mmark.1.md +++ b/mmark.1.md @@ -2,7 +2,7 @@ title: 'MMARK(1)' author: - Mmark Authors -date: February 2019 +date: October 2019 --- # NAME @@ -20,7 +20,7 @@ is, however, *also* suited for writing complete books and other technical docume Mmark provides an advanced markdown dialect that processes file(s) to produce internet-drafts in XML [RFC 7991](https://tools.ietf.org/html/rfc7991) format. Mmark can produce xml2rfc (aforementioned -RFC 7991), RFC 7749 (xml2rfc version 2), HTML5, manual pages and markdown output. +RFC 7991), HTML5, manual pages and markdown output. The syntax is detailed at [https://mmark.miek.nl/syntax](https://mmark.miek.nl/syntax). @@ -56,15 +56,9 @@ Compared to other markdown variants mmark adds: * BCP14 (RFC 2119) keyword detection. -## RFC 7749 - -This is currently the XML format used by the RFC editor for accepting Internet-Drafts. Some of these -turn into RFCs. For getting text output you'll need xml2rfc for the actual conversion. - ## RFC 7991 -This is the future XML format used by the RFC editor for accepting Internet-Drafts. A valid markdown -document can be turned in RFC 7749 or RFC 7991 XML. +This is the XML format used by the RFC editor for accepting Internet-Drafts. ## HTML5 @@ -101,10 +95,6 @@ The man renderer outputs nroff that can be viewed via man(1). : create HTML output. -**-2** - -: generate RFC 7749 XML. - **-markdown** : output (normalized) markdown. @@ -141,5 +131,6 @@ The man renderer outputs nroff that can be viewed via man(1). # ALSO SEE -RFC 7991 and RFC 7749. The main site for Mmark is [https://mmark.miek.nl](https://mmark.miek.nl). The syntax -used by mmark is explained in the [syntax page](https://mmark.miek.nl/post/syntax/). +RFC 7991 and (maybe) RFC 7749. The main site for Mmark is +[https://mmark.miek.nl](https://mmark.miek.nl). The syntax used by mmark is explained in the [syntax +page](https://mmark.miek.nl/post/syntax/). diff --git a/mmark.go b/mmark.go index 7c9381d..994dd89 100644 --- a/mmark.go +++ b/mmark.go @@ -18,7 +18,6 @@ import ( mmarkout "github.com/mmarkdown/mmark/render/markdown" "github.com/mmarkdown/mmark/render/mhtml" "github.com/mmarkdown/mmark/render/xml" - "github.com/mmarkdown/mmark/render/xml2" ) var ( @@ -29,7 +28,6 @@ var ( flagFragment = flag.Bool("fragment", false, "don't create a full document") flagHTML = flag.Bool("html", false, "create HTML output") flagIndex = flag.Bool("index", true, "generate an index at the end of the document") - flagTwo = flag.Bool("2", false, "generate RFC 7749 XML") flagMarkdown = flag.Bool("markdown", false, "generate markdown (experimental)") flagMan = flag.Bool("man", false, "generate manual pages (nroff)") flagWrite = flag.Bool("w", false, "write to source file when generating markdown") @@ -150,16 +148,6 @@ func main() { } renderer = html.NewRenderer(opts) - case *flagTwo: - opts := xml2.RendererOptions{ - Flags: xml2.CommonFlags, - Comments: [][]byte{[]byte("//"), []byte("#")}, - } - if *flagFragment { - opts.Flags |= xml2.XMLFragment - } - - renderer = xml2.NewRenderer(opts) case *flagMarkdown: opts := mmarkout.RendererOptions{TextWidth: *flagWidth} renderer = mmarkout.NewRenderer(opts) diff --git a/mmark_test.go b/mmark_test.go index 9026518..43e1a95 100644 --- a/mmark_test.go +++ b/mmark_test.go @@ -10,7 +10,6 @@ import ( "github.com/gomarkdown/markdown/parser" "github.com/mmarkdown/mmark/mparser" "github.com/mmarkdown/mmark/render/xml" - "github.com/mmarkdown/mmark/render/xml2" ) func TestMmarkXML(t *testing.T) { @@ -37,30 +36,6 @@ func TestMmarkXML(t *testing.T) { } } -func TestMmarkXML2(t *testing.T) { - dir := "testdata/2" - testFiles, err := ioutil.ReadDir(dir) - if err != nil { - t.Fatalf("could not read %s: %q", dir, err) - } - for _, f := range testFiles { - if f.IsDir() { - continue - } - - if filepath.Ext(f.Name()) != ".md" { - continue - } - base := f.Name()[:len(f.Name())-3] - opts := xml2.RendererOptions{ - Flags: xml2.CommonFlags | xml2.XMLFragment, - } - renderer := xml2.NewRenderer(opts) - - doTest(t, dir, base, renderer) - } -} - func doTest(t *testing.T, dir, basename string, renderer markdown.Renderer) { filename := filepath.Join(dir, basename+".md") input, err := ioutil.ReadFile(filename) diff --git a/render/xml2/bibliography.go b/render/xml2/bibliography.go deleted file mode 100644 index 933e354..0000000 --- a/render/xml2/bibliography.go +++ /dev/null @@ -1,66 +0,0 @@ -package xml2 - -import ( - "bytes" - goxml "encoding/xml" - "fmt" - "io" - - "github.com/gomarkdown/markdown/ast" - "github.com/mmarkdown/mmark/mast" - "github.com/mmarkdown/mmark/render/xml" -) - -func (r *Renderer) bibliography(w io.Writer, node *mast.Bibliography, entering bool) { - if len(node.GetChildren()) == 0 { - return - } - - if !entering { - r.outs(w, "\n") - return - } - - r.sectionClose(w, nil) - - switch node.Type { - case ast.CitationTypeInformative: - r.outs(w, ``) - case ast.CitationTypeNormative: - r.outs(w, ``) - } - r.cr(w) -} - -func (r *Renderer) bibliographyItem(w io.Writer, node *mast.BibliographyItem) { - if node.Reference != nil { - data, _ := goxml.MarshalIndent(node.Reference, "", " ") - r.out(w, data) - r.cr(w) - return - } - - tag := "" - switch { - case bytes.HasPrefix(node.Anchor, []byte("RFC")): - tag = makeRFCInclude(xml.ToolsRFC, fmt.Sprintf("reference.RFC.%s.xml", node.Anchor[3:])) - - case bytes.HasPrefix(node.Anchor, []byte("W3C.")): - tag = makeRFCInclude(xml.ToolsW3C, fmt.Sprintf("reference.W3C.%s.xml", node.Anchor[4:])) - - case bytes.HasPrefix(node.Anchor, []byte("I-D.")): - hash := bytes.Index(node.Anchor, []byte("#")) - if hash > 0 { - // rewrite # to - and we have our link - node.Anchor[hash] = '-' - defer func() { node.Anchor[hash] = '#' }() // never know if this will be used again - } - tag = makeRFCInclude(xml.ToolsID, fmt.Sprintf("reference.I-D.%s.xml", node.Anchor[4:])) - } - r.outs(w, tag) - r.cr(w) -} - -func makeRFCInclude(url, reference string) string { - return fmt.Sprintf("", url, reference) -} diff --git a/render/xml2/helpers.go b/render/xml2/helpers.go deleted file mode 100644 index 0789112..0000000 --- a/render/xml2/helpers.go +++ /dev/null @@ -1,130 +0,0 @@ -package xml2 - -import ( - "bytes" - "fmt" - "io" - "strings" - - "github.com/gomarkdown/markdown/ast" - "github.com/mmarkdown/mmark/mast" - "github.com/mmarkdown/mmark/render/xml" -) - -func (r *Renderer) out(w io.Writer, d []byte) { w.Write(d) } -func (r *Renderer) outs(w io.Writer, s string) { io.WriteString(w, s) } -func (r *Renderer) cr(w io.Writer) { r.outs(w, "\n") } - -func (r *Renderer) outAttr(w io.Writer, attrs []string) { - if len(attrs) > 0 { - io.WriteString(w, " ") - io.WriteString(w, strings.Join(attrs, " ")) - } -} - -func (r *Renderer) outTag(w io.Writer, name string, attrs []string) { - s := name - if len(attrs) > 0 { - s += " " + strings.Join(attrs, " ") - } - io.WriteString(w, s+">") -} - -func (r *Renderer) outOneOf(w io.Writer, outFirst bool, first string, second string) { - if outFirst { - r.outs(w, first) - } else { - r.outs(w, second) - } -} - -func (r *Renderer) outOneOfCr(w io.Writer, outFirst bool, first string, second string) { - if outFirst { - r.cr(w) - r.outs(w, first) - } else { - r.outs(w, second) - r.cr(w) - } -} - -func (r *Renderer) sectionClose(w io.Writer, new *ast.Heading) { - defer func() { - r.section = new - }() - - if r.section == nil { - return - } - - if r.section.IsSpecial { - tag := "" - if xml.IsAbstract(r.section.Literal) { - tag = "" - } - r.outs(w, tag) - r.cr(w) - return - } - - tag := "" - curLevel := r.section.Level - newLevel := 1 // close them all - if new != nil { - newLevel = new.Level - } - - // subheading in a heading - if newLevel > curLevel { - return - } - - for i := newLevel; i <= curLevel; i++ { - r.outs(w, tag) - r.cr(w) - } -} - -func (r *Renderer) ensureUniqueHeadingID(id string) string { - for count, found := r.headingIDs[id]; found; count, found = r.headingIDs[id] { - tmp := fmt.Sprintf("%s-%d", id, count+1) - - if _, tmpFound := r.headingIDs[tmp]; !tmpFound { - r.headingIDs[id] = count + 1 - id = tmp - } else { - id = id + "-1" - } - } - - if _, found := r.headingIDs[id]; !found { - r.headingIDs[id] = 0 - } - - return id -} - -func appendLanguageAttr(node ast.Node, info []byte) { - if len(info) == 0 { - return - } - endOfLang := bytes.IndexAny(info, "\t ") - if endOfLang < 0 { - endOfLang = len(info) - } - mast.SetAttribute(node, "type", info[:endOfLang]) -} - -// isHangText returns true if the grandparent is a definition list term. -func isHangText(node ast.Node) bool { - grandparent := node.GetParent().GetParent() - if grandparent == nil { - return false - } - if grandparent != nil { - if li, ok := grandparent.(*ast.ListItem); ok { - return li.ListFlags&ast.ListTypeTerm != 0 - } - } - return false -} diff --git a/render/xml2/renderer.go b/render/xml2/renderer.go deleted file mode 100644 index 484b92f..0000000 --- a/render/xml2/renderer.go +++ /dev/null @@ -1,893 +0,0 @@ -package xml2 - -import ( - "fmt" - "io" - "log" - "strings" - - "github.com/gomarkdown/markdown/ast" - "github.com/gomarkdown/markdown/html" - "github.com/mmarkdown/mmark/mast" - "github.com/mmarkdown/mmark/render/xml" -) - -// Flags control optional behavior of XML2 renderer. -type Flags int - -// HTML renderer configuration options. -const ( - FlagsNone Flags = 0 - XMLFragment Flags = 1 << iota // Don't generate a complete XML document - SkipHTML // Skip preformatted HTML blocks - skips comments - SkipImages // Skip embedded images - - CommonFlags Flags = FlagsNone -) - -// RendererOptions is a collection of supplementary parameters tweaking -// the behavior of various parts of XML2 renderer. -type RendererOptions struct { - // Callouts are supported and detected by setting this option to the callout prefix. - Callout string - - Flags Flags // Flags allow customizing this renderer's behavior - - // if set, called at the start of RenderNode(). Allows replacing - // rendering of some nodes - RenderNodeHook html.RenderNodeFunc - - // Comments is a list of comments the renderer should detect when - // parsing code blocks and detecting callouts. - Comments [][]byte - - // Generator is a comment that is inserted in the generated XML to show what rendered it. - Generator string -} - -// Renderer implements Renderer interface for IETF XMLv2 output. See RFC 7941. -type Renderer struct { - opts RendererOptions - - documentMatter ast.DocumentMatters // keep track of front/main/back matter - section *ast.Heading // current open section - title bool // did we output a title block - filter mast.FilterFunc // filter for attributes. - - // Track heading IDs to prevent ID collision in a single generation. - headingIDs map[string]int -} - -var filterFunc mast.FilterFunc = func(s string) bool { - switch s { - case "id": // will translate to anchor so OK. - return true - case "class": // there are no classes - return false - case "empty": // newer attributes from RFC 7991 - return false - } - - // l33t data- HTML5 attributes - if strings.HasPrefix(s, "data-") { - return false - } - - return true -} - -// NewRenderer creates and configures an Renderer object, which satisfies the Renderer interface. -func NewRenderer(opts RendererOptions) *Renderer { - html.IDTag = "anchor" - if opts.Generator == "" { - opts.Generator = xml.Generator - } - return &Renderer{opts: opts, headingIDs: make(map[string]int), filter: filterFunc} -} - -func (r *Renderer) text(w io.Writer, text *ast.Text) { - if _, parentIsLink := text.Parent.(*ast.Link); parentIsLink { - r.out(w, text.Literal) - return - } - - if heading, parentIsHeading := text.Parent.(*ast.Heading); parentIsHeading { - if heading.IsSpecial && xml.IsAbstract(heading.Literal) { - return - } - } - - html.EscapeHTML(w, text.Literal) -} - -func (r *Renderer) hardBreak(w io.Writer, node *ast.Hardbreak) { - r.outs(w, "") - r.cr(w) -} - -func (r *Renderer) strong(w io.Writer, node *ast.Strong, entering bool) { - // *iff* we have a text node as a child *and* that text is 2119, we output bcp14 tags, otherwise just string. - text := ast.GetFirstChild(node) - if t, ok := text.(*ast.Text); ok { - if xml.Is2119(t.Literal) { - // out as-is. - r.outOneOf(w, entering, "", "") - return - } - } - - // if we're in a table or only plain text is allowed. - if parent := node.Parent; parent != nil { - if _, isTableCell := parent.(*ast.TableCell); isTableCell { - return - } - } - - if _, isCaption := node.GetParent().(*ast.Caption); isCaption { - r.outOneOf(w, entering, "", "") - return - } - - r.outOneOf(w, entering, ``, "") -} - -func (r *Renderer) matter(w io.Writer, node *ast.DocumentMatter) { - r.sectionClose(w, nil) - - switch node.Matter { - case ast.DocumentMatterFront: - r.cr(w) - r.outs(w, "") - r.cr(w) - case ast.DocumentMatterMain: - r.cr(w) - r.outs(w, "") - r.cr(w) - r.cr(w) - r.outs(w, "") - r.cr(w) - case ast.DocumentMatterBack: - r.cr(w) - r.outs(w, "") - r.cr(w) - r.cr(w) - r.outs(w, "") - r.cr(w) - } - r.documentMatter = node.Matter -} - -func (r *Renderer) headingEnter(w io.Writer, heading *ast.Heading) { - r.cr(w) - - tag := "`) - r.cr(w) -} - -func (r *Renderer) heading(w io.Writer, node *ast.Heading, entering bool) { - if !entering { - r.headingExit(w, node) - return - } - - r.sectionClose(w, node) - - r.headingEnter(w, node) -} - -var rule = strings.Repeat("-", 60) - -func (r *Renderer) horizontalRule(w io.Writer, node *ast.HorizontalRule) { - if _, ok := node.Parent.(*ast.ListItem); ok { - r.outs(w, "") - r.outs(w, rule) - r.outs(w, "") - } else { - r.outs(w, "") - r.outs(w, rule) - r.outs(w, "") - } - r.cr(w) -} - -func (r *Renderer) citation(w io.Writer, node *ast.Citation, entering bool) { - if !entering { - return - } - - for i, c := range node.Destination { - if node.Type[i] == ast.CitationTypeSuppressed { - continue - } - - r.outTag(w, "") - } -} - -func (r *Renderer) paragraphEnter(w io.Writer, para *ast.Paragraph) { - // Skip outputting in lists and in caption figures. - if p, ok := para.Parent.(*ast.ListItem); ok { - // Fake multiple paragraphs by inserting a hard break. - if len(p.GetChildren()) > 1 { - first := ast.GetFirstChild(para.Parent) - if first != para { - r.hardBreak(w, &ast.Hardbreak{}) - } - } - return - } - if _, ok := para.Parent.(*ast.CaptionFigure); ok { - return - } - - tag := tagWithAttributes(" in lists and in caption figures. - if _, ok := para.Parent.(*ast.ListItem); ok { - return - } - if _, ok := para.Parent.(*ast.CaptionFigure); ok { - return - } - - r.outs(w, "") - r.cr(w) -} - -func (r *Renderer) paragraph(w io.Writer, para *ast.Paragraph, entering bool) { - if entering { - r.paragraphEnter(w, para) - } else { - r.paragraphExit(w, para) - } -} - -func (r *Renderer) listEnter(w io.Writer, nodeData *ast.List) { - if nodeData.IsFootnotesList { - return - } - r.cr(w) - - openTag := " 0 { - log.Printf("Attribute \"start\" not supported for list style=\"numbers\"") - } - } - if nodeData.ListFlags&ast.ListTypeDefinition != 0 { - mast.SetAttribute(nodeData, "style", []byte("hanging")) - } - } - - r.outTag(w, openTag, html.BlockAttrs(nodeData)) - r.cr(w) -} - -func (r *Renderer) listExit(w io.Writer, list *ast.List) { - if list.IsFootnotesList { - return - } - closeTag := "" - if list.ListFlags&ast.ListTypeOrdered != 0 { - //closeTag = "" - } - if list.ListFlags&ast.ListTypeDefinition != 0 { - //closeTag = "" - } - r.outs(w, closeTag) - - parent := list.Parent - switch parent.(type) { - case *ast.ListItem: - if ast.GetNextNode(list) != nil { - r.cr(w) - } - case *ast.Document, *ast.BlockQuote, *ast.Aside: - r.cr(w) - } -} - -func (r *Renderer) list(w io.Writer, list *ast.List, entering bool) { - // need to be wrapped in a paragraph, except when we're already in a list. - _, parentIsList := list.Parent.(*ast.ListItem) - if entering { - if !parentIsList { - r.paragraphEnter(w, &ast.Paragraph{}) - } - r.listEnter(w, list) - } else { - r.listExit(w, list) - if !parentIsList { - r.paragraphExit(w, &ast.Paragraph{}) - } - } -} - -func (r *Renderer) listItemEnter(w io.Writer, listItem *ast.ListItem) { - if listItem.RefLink != nil { // footnotes - return - } - - openTag := "" - if listItem.ListFlags&ast.ListTypeDefinition != 0 { - openTag = "" - } - if listItem.ListFlags&ast.ListTypeTerm != 0 { - openTag = "` - } - r.outs(w, closeTag) - r.cr(w) -} - -func (r *Renderer) listItem(w io.Writer, listItem *ast.ListItem, entering bool) { - if entering { - r.listItemEnter(w, listItem) - } else { - r.listItemExit(w, listItem) - } -} - -func (r *Renderer) codeBlock(w io.Writer, codeBlock *ast.CodeBlock) { - mast.AttributeInit(codeBlock) - appendLanguageAttr(codeBlock, codeBlock.Info) - - r.cr(w) - _, inFigure := codeBlock.Parent.(*ast.CaptionFigure) - if inFigure { - // Drop anchor for now, but need to figure out what to allow here. - mast.DeleteAttribute(codeBlock, "id") - r.outTag(w, "") - } else { - r.outs(w, "\n") - } - r.cr(w) -} - -func (r *Renderer) tableCell(w io.Writer, tableCell *ast.TableCell, entering bool) { - if !entering { - r.outOneOf(w, tableCell.IsHeader, "", "") - r.cr(w) - return - } - - // entering - mast.AttributeInit(tableCell) - openTag := "") - r.out(w, text) - r.outs(w, "") - return - } - if r.opts.Flags&SkipHTML == 0 { - html.EscapeHTML(w, span.Literal) - } -} - -func (r *Renderer) htmlBlock(w io.Writer, block *ast.HTMLBlock) { - if _, ok := xml.IsComment(block.Literal); ok { - return - } - if r.opts.Flags&SkipHTML == 0 { - html.EscapeHTML(w, block.Literal) - } -} -func (r *Renderer) callout(w io.Writer, callout *ast.Callout) { - r.outs(w, ``) - r.out(w, callout.ID) - r.outs(w, "") -} - -func (r *Renderer) crossReference(w io.Writer, cr *ast.CrossReference, entering bool) { - if isHangText(cr) { - if entering { - w.Write(cr.Destination) - } - return - } - - if entering { - r.outTag(w, "") -} - -func (r *Renderer) index(w io.Writer, index *ast.Index) { - r.outs(w, "") -} - -func (r *Renderer) link(w io.Writer, link *ast.Link, entering bool) { - if link.Footnote != nil { - return - } - - if !entering { - r.outs(w, ``) - return - } - - if isHangText(link) { - w.Write(link.Destination) - return - } - - r.outs(w, "`) -} - -func (r *Renderer) image(w io.Writer, node *ast.Image, entering bool) { - if entering { - r.imageEnter(w, node) - } else { - r.imageExit(w, node) - } -} - -func (r *Renderer) imageEnter(w io.Writer, image *ast.Image) { - r.outs(w, "\n") - html.EscapeHTML(w, image.Destination) - r.outs(w, ` `) -} - -func (r *Renderer) imageExit(w io.Writer, image *ast.Image) { - if image.Title != nil { - r.outs(w, ` "`) - html.EscapeHTML(w, image.Title) - r.outs(w, `"`) - } - r.outs(w, "\n") -} - -func (r *Renderer) code(w io.Writer, node *ast.Code) { - if isHangText(node) { - html.EscapeHTML(w, node.Literal) - return - } - if _, isCaption := node.GetParent().(*ast.Caption); isCaption { - html.EscapeHTML(w, node.Literal) - return - } - - // if we're in a table or only plain text is allowed. - if parent := node.Parent; parent != nil { - if _, isTableCell := parent.(*ast.TableCell); isTableCell { - html.EscapeHTML(w, node.Literal) - return - } - } - - r.outs(w, ``) - html.EscapeHTML(w, node.Literal) - r.outs(w, "") -} - -func (r *Renderer) mathBlock(w io.Writer, mathBlock *ast.MathBlock) { - r.outs(w, `
`+"\n") - if r.opts.Comments != nil { - xml.EscapeHTMLCallouts(w, mathBlock.Literal, r.opts.Comments) - } else { - html.EscapeHTML(w, mathBlock.Literal) - } - r.outs(w, `
`+"\n") - r.cr(w) -} - -func (r *Renderer) captionFigure(w io.Writer, captionFigure *ast.CaptionFigure, entering bool) { - for _, child := range captionFigure.GetChildren() { - if _, ok := child.(*ast.Table); ok { - return - } - if _, ok := child.(*ast.BlockQuote); ok { - return - } - } - - if !entering { - r.outs(w, "\n") - return - } - if captionFigure.HeadingID != "" { - mast.AttributeInit(captionFigure) - captionFigure.Attribute.ID = []byte(captionFigure.HeadingID) - } - - r.outs(w, "`) - - ast.RemoveFromTree(caption) - return - } - } - // Still here? Close tag. - r.outs(w, `>`) -} - -func (r *Renderer) table(w io.Writer, tab *ast.Table, entering bool) { - if !entering { - r.outs(w, "") - return - } - captionFigure, inFigure := tab.Parent.(*ast.CaptionFigure) - if inFigure { - if captionFigure.HeadingID != "" { - mast.AttributeInit(tab) - tab.Attribute.ID = []byte(captionFigure.HeadingID) - } - } - - r.outs(w, "`) - return - } - - r.outs(w, ` title="`) - - for _, child := range captionFigure.GetChildren() { - if caption, ok := child.(*ast.Caption); ok { - ast.WalkFunc(caption, func(node ast.Node, entering bool) ast.WalkStatus { - return r.RenderNode(w, node, entering) - }) - r.outs(w, `">`) - - ast.RemoveFromTree(caption) - return - } - } - // Still here? Close tag. - r.outs(w, `>`) -} - -func (r *Renderer) blockQuote(w io.Writer, block *ast.BlockQuote, entering bool) { - if !entering { - return - } - - list := &ast.List{} - list.Attribute = block.Attribute - if list.Attribute == nil { - list.Attribute = &ast.Attribute{Attrs: make(map[string][]byte)} - } - list.Attribute.Attrs["style"] = []byte("empty") - // if in a list, as a parent listItem that is empty, so subsequent "in-list" checks work. - if _, inList := block.Parent.(*ast.ListItem); inList { - list.Parent = &ast.ListItem{} - } - - listItem := &ast.ListItem{} - mast.MoveChildren(listItem, block) - ast.AppendChild(list, listItem) - - if captionFigure, ok := block.Parent.(*ast.CaptionFigure); ok { - for _, child := range captionFigure.GetChildren() { - if caption, ok := child.(*ast.Caption); ok { - listItem := &ast.ListItem{} - mast.MoveChildren(listItem, caption) - ast.AppendChild(list, listItem) - - ast.RemoveFromTree(caption) - } - } - } - - ast.WalkFunc(list, func(node ast.Node, entering bool) ast.WalkStatus { - return r.RenderNode(w, node, entering) - }) -} - -// RenderNode renders a markdown node to XML. -func (r *Renderer) RenderNode(w io.Writer, node ast.Node, entering bool) ast.WalkStatus { - - mast.AttributeFilter(node, r.filter) - - if r.opts.RenderNodeHook != nil { - status, didHandle := r.opts.RenderNodeHook(w, node, entering) - if didHandle { - return status - } - } - - switch node := node.(type) { - case *ast.Document: - // do nothing - case *mast.Title: - r.titleBlock(w, node) - r.title = true - case *mast.Bibliography: - r.bibliography(w, node, entering) - case *mast.BibliographyItem: - r.bibliographyItem(w, node) - case *mast.DocumentIndex, *mast.IndexLetter, *mast.IndexItem, *mast.IndexSubItem, *mast.IndexLink: - // generated by xml2rfc, do nothing. - case *mast.ReferenceBlock: - // skip, added and done by AddBibliography - case *ast.Text: - r.text(w, node) - case *ast.Softbreak: - r.cr(w) - case *ast.Hardbreak: - r.hardBreak(w, node) - case *ast.NonBlockingSpace: - // skip - case *ast.Callout: - r.callout(w, node) - case *ast.Emph: - - // if we're in a table or only plain text is allowed. - if parent := node.Parent; parent != nil { - if _, isTableCell := parent.(*ast.TableCell); isTableCell { - return ast.GoToNext - } - } - - if isHangText(node) { - if entering { - html.EscapeHTML(w, node.Literal) - } - } else { - if _, isCaption := node.GetParent().(*ast.Caption); isCaption { - r.outOneOf(w, entering, "", "") - } else { - r.outOneOf(w, entering, ``, "") - } - } - case *ast.Strong: - r.strong(w, node, entering) - case *ast.Del: - // if we're in a table or only plain text is allowed. - if parent := node.Parent; parent != nil { - if _, isTableCell := parent.(*ast.TableCell); isTableCell { - return ast.GoToNext - } - } - // ala strikethrough, just keep the tildes - r.outOneOf(w, entering, "~", "~") - case *ast.Citation: - r.citation(w, node, entering) - case *ast.DocumentMatter: - if entering { - r.matter(w, node) - } - case *ast.Heading: - r.heading(w, node, entering) - case *ast.HorizontalRule: - r.horizontalRule(w, node) - case *ast.Paragraph: - r.paragraph(w, node, entering) - case *ast.HTMLSpan: - r.htmlSpan(w, node) - case *ast.HTMLBlock: - r.htmlBlock(w, node) - case *ast.List: - r.list(w, node, entering) - case *ast.ListItem: - r.listItem(w, node, entering) - case *ast.CodeBlock: - r.codeBlock(w, node) - case *ast.Caption: - // no tags because we are used in attributes, i.e. title= - // See comment in xml/renderer.go. The same is true here, *but*, because we don't - // output any tags, the problem does not show up. As a matter of consistency we apply - // the same (dumb) precaution. - if len(node.GetChildren()) > 0 { - r.outOneOf(w, entering, "", "") - } - case *ast.CaptionFigure: - r.captionFigure(w, node, entering) - case *ast.Table: - r.table(w, node, entering) - case *ast.TableCell: - r.tableCell(w, node, entering) - case *ast.TableHeader: - r.outOneOf(w, entering, "", "") - case *ast.TableBody: - r.tableBody(w, node, entering) - case *ast.TableRow: - r.outOneOf(w, entering, "", "") - case *ast.TableFooter: - r.outOneOf(w, entering, "", "") - case *ast.BlockQuote: - r.blockQuote(w, node, entering) - case *ast.Aside: - // ignore and text render the child text as-is. - case *ast.CrossReference: - r.crossReference(w, node, entering) - case *ast.Index: - if entering { - r.index(w, node) - } - case *ast.Link: - r.link(w, node, entering) - case *ast.Math: - r.outOneOf(w, true, ``, "") - html.EscapeHTML(w, node.Literal) - r.outOneOf(w, false, ``, "") - case *ast.Image: - if r.opts.Flags&SkipImages != 0 { - return ast.SkipChildren - } - r.image(w, node, entering) - case *ast.Code: - r.code(w, node) - case *ast.MathBlock: - r.mathBlock(w, node) - case *ast.Subscript: - r.outOneOf(w, true, "_(", ")") - if entering { - html.Escape(w, node.Literal) - } - r.outOneOf(w, false, "_(", ")") - case *ast.Superscript: - r.outOneOf(w, true, "^(", ")") - if entering { - html.Escape(w, node.Literal) - } - r.outOneOf(w, false, "^(", ")") - default: - panic(fmt.Sprintf("Unknown node %T", node)) - } - return ast.GoToNext -} - -// RenderHeader writes HTML document preamble and TOC if requested. -func (r *Renderer) RenderHeader(w io.Writer, ast ast.Node) { - if r.opts.Flags&XMLFragment != 0 { - return - } - - r.writeDocumentHeader(w) -} - -// RenderFooter writes HTML document footer. -func (r *Renderer) RenderFooter(w io.Writer, _ ast.Node) { - r.sectionClose(w, nil) - - switch r.documentMatter { - case ast.DocumentMatterFront: - r.outs(w, "\n\n") - case ast.DocumentMatterMain: - r.outs(w, "\n\n") - case ast.DocumentMatterBack: - r.outs(w, "\n\n") - } - - if r.title { - io.WriteString(w, "\n") - } -} - -func (r *Renderer) writeDocumentHeader(w io.Writer) { - if r.opts.Flags&XMLFragment != 0 { - return - } - r.outs(w, ``) - r.cr(w) - r.outs(w, r.opts.Generator) - r.cr(w) - r.outs(w, ``) - r.cr(w) -} - -func tagWithAttributes(name string, attrs []string) string { - s := name - if len(attrs) > 0 { - s += " " + strings.Join(attrs, " ") - } - return s + ">" -} diff --git a/render/xml2/title.go b/render/xml2/title.go deleted file mode 100644 index c2651d1..0000000 --- a/render/xml2/title.go +++ /dev/null @@ -1,88 +0,0 @@ -package xml2 - -import ( - "io" - - "github.com/gomarkdown/markdown/ast" - "github.com/gomarkdown/markdown/html" - "github.com/mmarkdown/mmark/mast" - "github.com/mmarkdown/mmark/render/xml" -) - -func (r *Renderer) titleBlock(w io.Writer, t *mast.Title) { - // Order is fixed in RFC 7749. - - if t.IsTriggerDash() { - return - } - - d := t.TitleData - if d == nil { - return - } - consensusToTerm := map[bool]string{ - false: "no", - true: "yes", - } - - attrs := xml.Attributes( - []string{"ipr", "submissionType", "category", "xml:lang", "consensus"}, - []string{d.Ipr, d.SeriesInfo.Stream, xml.StatusToCategory[d.SeriesInfo.Status], "en", consensusToTerm[d.Consensus]}, - ) - attrs = append(attrs, xml.Attributes( - []string{"updates", "obsoletes"}, - []string{xml.IntSliceToString(d.Updates), xml.IntSliceToString(d.Obsoletes)}, - )...) - - // Depending on the SeriesInfo.Name we're dealing with an RFC or Internet-Draft. - switch d.SeriesInfo.Name { - case "RFC": - attrs = append(attrs, `number="`+d.SeriesInfo.Value+"\"") - case "Internet-Draft": // case sensitive? Or throw error in toml checker? - attrs = append(attrs, `docName="`+d.SeriesInfo.Value+"\"") - case "DOI": - // ? - } - - r.outTag(w, "`) - r.outs(w, ``) - r.outs(w, ``) - r.outs(w, ``) - r.outs(w, ``) - r.outs(w, ``) - - r.matter(w, &ast.DocumentMatter{Matter: ast.DocumentMatterFront}) - - attrs = xml.Attributes([]string{"abbrev"}, []string{d.Abbrev}) - r.outTag(w, "") - - // use a fake xml rendering to hook into the generation of these title elements defined there. - faker := xml.NewRenderer(xml.RendererOptions{}) - - for _, author := range d.Author { - faker.TitleAuthor(w, author) - } - - faker.TitleDate(w, d.Date) - - r.outs(w, "") - html.EscapeHTML(w, []byte(d.Area)) - r.outs(w, "") - - r.outs(w, "") - html.EscapeHTML(w, []byte(d.Workgroup)) - r.outs(w, "") - - faker.TitleKeyword(w, d.Keyword) - - // abstract - handled by paragraph - // note - handled by paragraph - // boilerplate - not supported. - - return -} diff --git a/testdata/2/abstract.md b/testdata/2/abstract.md deleted file mode 100644 index bd8b210..0000000 --- a/testdata/2/abstract.md +++ /dev/null @@ -1,3 +0,0 @@ -.# Abstract - -Hi! diff --git a/testdata/2/abstract.xml b/testdata/2/abstract.xml deleted file mode 100644 index 588d87a..0000000 --- a/testdata/2/abstract.xml +++ /dev/null @@ -1,2 +0,0 @@ -Hi! - diff --git a/testdata/2/anchor.md b/testdata/2/anchor.md deleted file mode 100644 index b01bb7d..0000000 --- a/testdata/2/anchor.md +++ /dev/null @@ -1,5 +0,0 @@ -{#fig1} -~~~ -println("go") -~~~ -See (#fig) diff --git a/testdata/2/anchor.xml b/testdata/2/anchor.xml deleted file mode 100644 index c2b57cc..0000000 --- a/testdata/2/anchor.xml +++ /dev/null @@ -1,4 +0,0 @@ -
println("go") -
- -See diff --git a/testdata/2/caption-escape.md b/testdata/2/caption-escape.md deleted file mode 100644 index 5f4402c..0000000 --- a/testdata/2/caption-escape.md +++ /dev/null @@ -1,4 +0,0 @@ -~~~ -fmt.Printf("Go!") -~~~ -Figure: this is a \ diff --git a/testdata/2/caption-escape.xml b/testdata/2/caption-escape.xml deleted file mode 100644 index 9c0f8e5..0000000 --- a/testdata/2/caption-escape.xml +++ /dev/null @@ -1,4 +0,0 @@ -
-fmt.Printf("Go!") - -
diff --git a/testdata/2/caption-id.md b/testdata/2/caption-id.md deleted file mode 100644 index c964a7a..0000000 --- a/testdata/2/caption-id.md +++ /dev/null @@ -1,5 +0,0 @@ -Name | Age ---------|------ -Bob | 27 -Alice | 23 -Table: This is a proper table caption. {#data_types} diff --git a/testdata/2/caption-id.xml b/testdata/2/caption-id.xml deleted file mode 100644 index 96645d6..0000000 --- a/testdata/2/caption-id.xml +++ /dev/null @@ -1,12 +0,0 @@ - -Name -Age - - -Bob -27 - -Alice -23 - - diff --git a/testdata/2/codeblock.md b/testdata/2/codeblock.md deleted file mode 100644 index 931ca22..0000000 --- a/testdata/2/codeblock.md +++ /dev/null @@ -1,3 +0,0 @@ -~~~go -ready(Tea, 2) -~~~ diff --git a/testdata/2/codeblock.xml b/testdata/2/codeblock.xml deleted file mode 100644 index 99380c6..0000000 --- a/testdata/2/codeblock.xml +++ /dev/null @@ -1,2 +0,0 @@ -
ready(Tea, 2) -
diff --git a/testdata/2/em.md b/testdata/2/em.md deleted file mode 100644 index 01a0943..0000000 --- a/testdata/2/em.md +++ /dev/null @@ -1 +0,0 @@ -Hi *from* diff --git a/testdata/2/em.xml b/testdata/2/em.xml deleted file mode 100644 index 627b726..0000000 --- a/testdata/2/em.xml +++ /dev/null @@ -1 +0,0 @@ -Hi from diff --git a/testdata/2/hangtext.md b/testdata/2/hangtext.md deleted file mode 100644 index 4f943eb..0000000 --- a/testdata/2/hangtext.md +++ /dev/null @@ -1,5 +0,0 @@ -(#basics) -: We'll look at the basic types. - -(#functions) -: Here we look at functions. diff --git a/testdata/2/hangtext.xml b/testdata/2/hangtext.xml deleted file mode 100644 index ee752bd..0000000 --- a/testdata/2/hangtext.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - -We'll look at the basic types. - -Here we look at functions. - - diff --git a/testdata/2/header-escape.md b/testdata/2/header-escape.md deleted file mode 100644 index 137cc5c..0000000 --- a/testdata/2/header-escape.md +++ /dev/null @@ -1 +0,0 @@ -# \ and \ Operations diff --git a/testdata/2/header-escape.xml b/testdata/2/header-escape.xml deleted file mode 100644 index 73b9a41..0000000 --- a/testdata/2/header-escape.xml +++ /dev/null @@ -1,2 +0,0 @@ -
-
diff --git a/testdata/2/header.md b/testdata/2/header.md deleted file mode 100644 index 8b2a3d3..0000000 --- a/testdata/2/header.md +++ /dev/null @@ -1 +0,0 @@ -# Config Operations diff --git a/testdata/2/header.xml b/testdata/2/header.xml deleted file mode 100644 index 2163d74..0000000 --- a/testdata/2/header.xml +++ /dev/null @@ -1,2 +0,0 @@ -
-
diff --git a/testdata/2/hr.md b/testdata/2/hr.md deleted file mode 100644 index 681cf34..0000000 --- a/testdata/2/hr.md +++ /dev/null @@ -1,3 +0,0 @@ -a -**** -b diff --git a/testdata/2/hr.xml b/testdata/2/hr.xml deleted file mode 100644 index 4fcb3b2..0000000 --- a/testdata/2/hr.xml +++ /dev/null @@ -1,3 +0,0 @@ -a ------------------------------------------------------------- -b diff --git a/testdata/2/images.md b/testdata/2/images.md deleted file mode 100644 index b2bcd1c..0000000 --- a/testdata/2/images.md +++ /dev/null @@ -1,5 +0,0 @@ -![Alt](fig/bumper-inverse.png "Title") - -![](fig/bumper-inverse.png "Title2") - -![](fig/bumper-inverse.png) diff --git a/testdata/2/images.xml b/testdata/2/images.xml deleted file mode 100644 index 4eb2256..0000000 --- a/testdata/2/images.xml +++ /dev/null @@ -1,9 +0,0 @@ - -fig/bumper-inverse.png Alt "Title" - - -fig/bumper-inverse.png "Title2" - - -fig/bumper-inverse.png - diff --git a/testdata/2/list-in-list.md b/testdata/2/list-in-list.md deleted file mode 100644 index 70dc0a4..0000000 --- a/testdata/2/list-in-list.md +++ /dev/null @@ -1,5 +0,0 @@ -1. a -2. b -3. c - * 1 - * 2 diff --git a/testdata/2/list-in-list.xml b/testdata/2/list-in-list.xml deleted file mode 100644 index a733e2e..0000000 --- a/testdata/2/list-in-list.xml +++ /dev/null @@ -1,11 +0,0 @@ - - -a -b -c - -1 -2 - - - diff --git a/testdata/2/list-paragraphs.md b/testdata/2/list-paragraphs.md deleted file mode 100644 index 4baa026..0000000 --- a/testdata/2/list-paragraphs.md +++ /dev/null @@ -1,6 +0,0 @@ -* Item1 -* Item2 -* More - more1 - - more2 diff --git a/testdata/2/list-paragraphs.xml b/testdata/2/list-paragraphs.xml deleted file mode 100644 index cf0c995..0000000 --- a/testdata/2/list-paragraphs.xml +++ /dev/null @@ -1,9 +0,0 @@ - - -Item1 -Item2 -More -more1 -more2 - - diff --git a/testdata/2/quote-in-list.md b/testdata/2/quote-in-list.md deleted file mode 100644 index 698b610..0000000 --- a/testdata/2/quote-in-list.md +++ /dev/null @@ -1,8 +0,0 @@ -1. A - -2. B - - > `func` - > Push - - C diff --git a/testdata/2/quote-in-list.xml b/testdata/2/quote-in-list.xml deleted file mode 100644 index 3e2f152..0000000 --- a/testdata/2/quote-in-list.xml +++ /dev/null @@ -1,12 +0,0 @@ - - -A -B - -func -Push - -C - - - diff --git a/testdata/2/sections.md b/testdata/2/sections.md deleted file mode 100644 index b1d8529..0000000 --- a/testdata/2/sections.md +++ /dev/null @@ -1,9 +0,0 @@ -# implications - -## First - -The big first - -## Second - -The big second diff --git a/testdata/2/sections.xml b/testdata/2/sections.xml deleted file mode 100644 index 59c1832..0000000 --- a/testdata/2/sections.xml +++ /dev/null @@ -1,10 +0,0 @@ -
- -
-The big first -
- -
-The big second -
-
diff --git a/testdata/2/table-align.md b/testdata/2/table-align.md deleted file mode 100644 index 0979825..0000000 --- a/testdata/2/table-align.md +++ /dev/null @@ -1,5 +0,0 @@ -Name | Age -:------:|:----- -Bob | 27 -Alice | 23 -Table: This is a proper table caption diff --git a/testdata/2/table-align.xml b/testdata/2/table-align.xml deleted file mode 100644 index bab8149..0000000 --- a/testdata/2/table-align.xml +++ /dev/null @@ -1,12 +0,0 @@ - -Name -Age - - -Bob -27 - -Alice -23 - - diff --git a/testdata/2/table-caption.md b/testdata/2/table-caption.md deleted file mode 100644 index 4c98a53..0000000 --- a/testdata/2/table-caption.md +++ /dev/null @@ -1,10 +0,0 @@ -MsgType | Description -:------:|:---------------------------------------- -0x01 | Supported SRTP Protection Profiles -0x02 | Unsupported Version -0x03 | Media Keys -0x04 | Tunneled DTLS -0x05 | Endpoint Disconnect -Table: Data Type Values for the DTLS Tunnel Protocol {#data_types} - -The value 0x00 and all values in the range 0x06 to 0xFF are reserved. diff --git a/testdata/2/table-caption.xml b/testdata/2/table-caption.xml deleted file mode 100644 index 8cfdd47..0000000 --- a/testdata/2/table-caption.xml +++ /dev/null @@ -1,22 +0,0 @@ - -MsgType -Description - - -0x01 -Supported SRTP Protection Profiles - -0x02 -Unsupported Version - -0x03 -Media Keys - -0x04 -Tunneled DTLS - -0x05 -Endpoint Disconnect - -The value 0x00 and all values in the range 0x06 to 0xFF are reserved. - diff --git a/testdata/2/table-em.md b/testdata/2/table-em.md deleted file mode 100644 index 5f0262a..0000000 --- a/testdata/2/table-em.md +++ /dev/null @@ -1,4 +0,0 @@ -**Name** | *Age* ---------|------ -*Bob* | **27** -`Alice` | _23_ diff --git a/testdata/2/table-em.xml b/testdata/2/table-em.xml deleted file mode 100644 index ff4ee3f..0000000 --- a/testdata/2/table-em.xml +++ /dev/null @@ -1,12 +0,0 @@ - -Name -Age - - -Bob -27 - -Alice -23 - - diff --git a/testdata/2/table.md b/testdata/2/table.md deleted file mode 100644 index 4876afc..0000000 --- a/testdata/2/table.md +++ /dev/null @@ -1,5 +0,0 @@ -Name | Age ---------|------ -Bob | 27 -Alice | 23 -Table: This is a proper table caption diff --git a/testdata/2/table.xml b/testdata/2/table.xml deleted file mode 100644 index ccfb3b7..0000000 --- a/testdata/2/table.xml +++ /dev/null @@ -1,12 +0,0 @@ - -Name -Age - - -Bob -27 - -Alice -23 - -