diff --git a/packages/lwdita-xdita/src/converter.ts b/packages/lwdita-xdita/src/converter.ts index c8723992..c4b95be9 100644 --- a/packages/lwdita-xdita/src/converter.ts +++ b/packages/lwdita-xdita/src/converter.ts @@ -21,8 +21,6 @@ import { Attributes, BasicValue, TextNode, getNodeClass, JDita, BaseNode, Docume import { InMemoryTextSimpleOutputStreamCollector } from "./stream"; import { XditaSerializer } from "./xdita-serializer"; -/** TODO: Add tests for this module */ - /** * Converts XML to an AST document tree * diff --git a/packages/lwdita-xdita/test/converter.spec.ts b/packages/lwdita-xdita/test/converter.spec.ts index 7e09dad9..7b76ba9c 100644 --- a/packages/lwdita-xdita/test/converter.spec.ts +++ b/packages/lwdita-xdita/test/converter.spec.ts @@ -17,8 +17,11 @@ along with this program. If not, see . import { expect } from 'chai'; -import { jditaToAst, serializeToXdita, xditaToAst, xditaToJdita } from '../src/converter'; +import { astToJdita, jditaToAst, serializeToXdita, xditaToAst, xditaToJdita } from '../src/converter'; import { DocumentNode } from "@evolvedbinary/lwdita-ast"; +import { fullAstObject, fullJditaObject, fullXditaExample } from './test-utils'; +import { InMemoryTextSimpleOutputStreamCollector } from '../src/stream'; +import { XditaSerializer } from '../src/xdita-serializer'; describe('xditaToAst', () => { @@ -258,4 +261,40 @@ describe('jditaToAst', () => { expect(textNode.static.nodeName).to.equal('cdata'); expect(textNode.readProp("content")).to.equal('cdata'); }) +}); + + +describe('A round trip conversion between xdita, ast, and jdita', () => { + // This test ensures that the conversion between the three formats is lossless and reversible. + + const xdita = fullXditaExample; + + it('converts xdita to ast', async () => { + const ast = await xditaToAst(xdita); + expect(ast).to.deep.equal(fullAstObject); + }); + + it('converts ast to jdita', async () => { + const ast = await xditaToAst(xdita); + const jdita = astToJdita(ast); + expect(jdita).to.deep.equal(fullJditaObject); + }); + + it('converts jdita to ast', async () => { + const ast = await xditaToAst(xdita); + const jdita = astToJdita(ast); + const newAst = jditaToAst(jdita); + expect(newAst).to.deep.equal(fullAstObject); + }); + + it('converts ast to xdita', async () => { + const ast = await xditaToAst(xdita); + const jdita = astToJdita(ast); + const newAst = jditaToAst(jdita); + const outStream = new InMemoryTextSimpleOutputStreamCollector(); + const serializer = new XditaSerializer(outStream); + serializer.serialize(newAst); + const newXdita = outStream.getText(); + expect(newXdita).to.equal(xdita); + }); }); \ No newline at end of file diff --git a/packages/lwdita-xdita/test/sample.xml b/packages/lwdita-xdita/test/sample.xml new file mode 100644 index 00000000..597f0026 --- /dev/null +++ b/packages/lwdita-xdita/test/sample.xml @@ -0,0 +1,117 @@ + + + + + <b>bold</b> and <em>emphasized</em> and <i>italic</i> and <ph>Phrase content</ph> and <strong>strong</strong> + and <sub>subscript</sub> and <sup>superscipt</sup> and <tt>tele type</tt> and <u>underline</u> + <image></image> + + Short description of the full topic. + + + + + + + +

Paragraph content

+ +
    +
  1. Ordered list item

  2. +
+
+ +
Definition term
+

Definition description

+
+
+
Preformatted content
+ + + + title + + + + + Table title + +

Header 1

+

Header 2

+
+ +

Row 1, Cell 1

+

Row 1, Cell 2

+
+ +

Row 2, Cell 1

+

Row 2, Cell 2

+
+
+ + + Figure title + Figure description + alt text + + + +

Note content

+
+
+ Section title + +

Section content

+
+
+ + + + +
+ +
\ No newline at end of file diff --git a/packages/lwdita-xdita/test/test-utils.ts b/packages/lwdita-xdita/test/test-utils.ts index 501850ae..a860f3b9 100644 --- a/packages/lwdita-xdita/test/test-utils.ts +++ b/packages/lwdita-xdita/test/test-utils.ts @@ -1,4 +1,4 @@ -/*! + /*! Copyright (C) 2020 Evolved Binary This program is free software: you can redistribute it and/or modify @@ -44,3 +44,2661 @@ export const AUDIO_NODE_OBJECT = { } }; export const XMLNODE_UNKNOWN = `{"name":"unknown","attributes":{},"ns":{},"prefix":"","local":"audio","uri":"","isSelfClosing":true}`; + +export const fullXditaExample = ` + <b>bold</b> and <em>emphasized</em> and <i>italic</i> and <ph>Phrase content</ph> and <strong>strong</strong> + and <sub>subscript</sub> and <sup>superscipt</sup> and <tt>tele type</tt> and <u>underline</u><image/> + Short description of the full topic.

Paragraph content

  1. Ordered list item

Definition term

Definition description

Preformatted content
titleTable title

Header 1

Header 2

Row 1, Cell 1

Row 1, Cell 2

Row 2, Cell 1

Row 2, Cell 2

Figure titleFigure descriptionalt text

Note content

Section title

Section content

` + +export const fullAstObject = { + _children: [ + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + specializations: undefined, + id: "fullTopic", + "xmlns:ditaarch": undefined, + "ditaarch:DITAArchVersion": undefined, + }, + _children: [ + { + _props: { + dir: "ltr", + "xml:lang": "english", + translate: "no", + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "\n ", + }, + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "bold", + }, + }, + ], + }, + { + _props: { + content: " and ", + }, + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "emphasized", + }, + }, + ], + }, + { + _props: { + content: " and ", + }, + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "italic", + }, + }, + ], + }, + { + _props: { + content: " and ", + }, + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Phrase content", + }, + }, + ], + }, + { + _props: { + content: " and ", + }, + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "strong", + }, + }, + ], + }, + { + _props: { + content: "\n and ", + }, + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "subscript", + }, + }, + ], + }, + { + _props: { + content: " and ", + }, + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "superscipt", + }, + }, + ], + }, + { + _props: { + content: " and ", + }, + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "tele type", + }, + }, + ], + }, + { + _props: { + content: " and ", + }, + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "underline", + }, + }, + ], + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: undefined, + format: undefined, + scope: undefined, + width: undefined, + height: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + }, + { + _props: { + content: "\n ", + }, + }, + ], + }, + { + _props: { + props: undefined, + id: undefined, + conref: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Short description of the full topic.", + }, + }, + ], + }, + { + _props: { + props: "metadata", + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + props: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + name: "test", + content: "test", + class: undefined, + }, + }, + ], + }, + ], + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: "outputclass", + class: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Paragraph content", + }, + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Unordered list item", + }, + }, + ], + }, + ], + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Ordered list item", + }, + }, + ], + }, + ], + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Definition term", + }, + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Definition description", + }, + }, + ], + }, + ], + }, + ], + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + "xml:space": undefined, + }, + _children: [ + { + _props: { + content: "Preformatted content", + }, + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + keyref: undefined, + href: undefined, + format: undefined, + scope: undefined, + outputclass: undefined, + class: undefined, + autoplay: "false", + controls: "true", + loop: "false", + muted: "false", + tabindex: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Theme song for the LwDITA podcast", + }, + }, + ], + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + props: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "The theme song is not available.", + }, + }, + ], + }, + ], + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: "theme-song.mp3", + format: undefined, + scope: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: "theme-song.vtt", + format: undefined, + scope: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + kind: undefined, + srclang: "en", + }, + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: undefined, + format: undefined, + scope: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + width: "400px", + height: "300px", + autoplay: undefined, + controls: undefined, + loop: "false", + muted: "false", + tabindex: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Video about the Sensei Sushi promise.", + }, + }, + ], + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + props: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: "video-not-available.png", + format: undefined, + scope: undefined, + width: undefined, + height: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "This video cannot be displayed.", + }, + }, + ], + }, + ], + }, + ], + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + props: undefined, + href: "sensei-video.jpg", + format: undefined, + scope: undefined, + id: undefined, + conref: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: "sensei-video.mp4", + format: undefined, + scope: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: "sensei-video.ogg", + format: undefined, + scope: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: "sensei-video.webm", + format: undefined, + scope: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: "sensei-video.vtt", + format: undefined, + scope: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + kind: undefined, + srclang: "en", + }, + }, + ], + }, + { + _props: { + scale: undefined, + frame: undefined, + expanse: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + props: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "title", + }, + }, + ], + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Table title", + }, + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + colspan: undefined, + rowspan: undefined, + scope: undefined, + headers: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Header 1", + }, + }, + ], + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + colspan: undefined, + rowspan: undefined, + scope: undefined, + headers: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Header 2", + }, + }, + ], + }, + ], + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + colspan: undefined, + rowspan: undefined, + scope: undefined, + headers: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Row 1, Cell 1", + }, + }, + ], + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + colspan: undefined, + rowspan: undefined, + scope: undefined, + headers: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Row 1, Cell 2", + }, + }, + ], + }, + ], + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + colspan: undefined, + rowspan: undefined, + scope: undefined, + headers: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Row 2, Cell 1", + }, + }, + ], + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + colspan: undefined, + rowspan: undefined, + scope: undefined, + headers: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Row 2, Cell 2", + }, + }, + ], + }, + ], + }, + ], + }, + ], + }, + { + _props: { + scale: undefined, + frame: undefined, + expanse: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + props: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Figure title", + }, + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Figure description", + }, + }, + ], + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: "images/image.png", + format: undefined, + scope: undefined, + width: undefined, + height: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "alt text", + }, + }, + ], + }, + ], + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + type: "note", + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Note content", + }, + }, + ], + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Section title", + }, + }, + ], + }, + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + content: "Section content", + }, + }, + ], + }, + ], + }, + { + _props: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + props: undefined, + outputclass: undefined, + class: undefined, + }, + _children: [ + { + _props: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + id: "footnote", + callout: undefined, + }, + }, + ], + }, + ], + }, + ], + }, + ], +}; + +export const fullJditaObject = { + nodeName: "document", + attributes: undefined, + children: [ + { + nodeName: "topic", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + specializations: undefined, + id: "fullTopic", + "xmlns:ditaarch": undefined, + "ditaarch:DITAArchVersion": undefined, + }, + children: [ + { + nodeName: "title", + attributes: { + dir: "ltr", + "xml:lang": "english", + translate: "no", + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "\n ", + }, + { + nodeName: "b", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "bold", + }, + ], + }, + { + nodeName: "text", + content: " and ", + }, + { + nodeName: "em", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "emphasized", + }, + ], + }, + { + nodeName: "text", + content: " and ", + }, + { + nodeName: "i", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "italic", + }, + ], + }, + { + nodeName: "text", + content: " and ", + }, + { + nodeName: "ph", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Phrase content", + }, + ], + }, + { + nodeName: "text", + content: " and ", + }, + { + nodeName: "strong", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "strong", + }, + ], + }, + { + nodeName: "text", + content: "\n and ", + }, + { + nodeName: "sub", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "subscript", + }, + ], + }, + { + nodeName: "text", + content: " and ", + }, + { + nodeName: "sup", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "superscipt", + }, + ], + }, + { + nodeName: "text", + content: " and ", + }, + { + nodeName: "tt", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "tele type", + }, + ], + }, + { + nodeName: "text", + content: " and ", + }, + { + nodeName: "u", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "underline", + }, + ], + }, + { + nodeName: "image", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: undefined, + format: undefined, + scope: undefined, + width: undefined, + height: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: undefined, + }, + { + nodeName: "text", + content: "\n ", + }, + ], + }, + { + nodeName: "shortdesc", + attributes: { + props: undefined, + id: undefined, + conref: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Short description of the full topic.", + }, + ], + }, + { + nodeName: "prolog", + attributes: { + props: "metadata", + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "metadata", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + props: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "othermeta", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + name: "test", + content: "test", + class: undefined, + }, + children: undefined, + }, + ], + }, + ], + }, + { + nodeName: "body", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: "outputclass", + class: undefined, + }, + children: [ + { + nodeName: "p", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Paragraph content", + }, + ], + }, + { + nodeName: "ul", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "li", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "p", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Unordered list item", + }, + ], + }, + ], + }, + ], + }, + { + nodeName: "ol", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "li", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "p", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Ordered list item", + }, + ], + }, + ], + }, + ], + }, + { + nodeName: "dl", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "dlentry", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "dt", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Definition term", + }, + ], + }, + { + nodeName: "dd", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "p", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Definition description", + }, + ], + }, + ], + }, + ], + }, + ], + }, + { + nodeName: "pre", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + "xml:space": undefined, + }, + children: [ + { + nodeName: "text", + content: "Preformatted content", + }, + ], + }, + { + nodeName: "audio", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + keyref: undefined, + href: undefined, + format: undefined, + scope: undefined, + outputclass: undefined, + class: undefined, + autoplay: "false", + controls: "true", + loop: "false", + muted: "false", + tabindex: undefined, + }, + children: [ + { + nodeName: "desc", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Theme song for the LwDITA podcast", + }, + ], + }, + { + nodeName: "fallback", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + props: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "p", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "The theme song is not available.", + }, + ], + }, + ], + }, + { + nodeName: "media-source", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: "theme-song.mp3", + format: undefined, + scope: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: undefined, + }, + { + nodeName: "media-track", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: "theme-song.vtt", + format: undefined, + scope: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + kind: undefined, + srclang: "en", + }, + children: undefined, + }, + ], + }, + { + nodeName: "video", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: undefined, + format: undefined, + scope: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + width: "400px", + height: "300px", + autoplay: undefined, + controls: undefined, + loop: "false", + muted: "false", + tabindex: undefined, + }, + children: [ + { + nodeName: "desc", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Video about the Sensei Sushi promise.", + }, + ], + }, + { + nodeName: "fallback", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + props: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "image", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: "video-not-available.png", + format: undefined, + scope: undefined, + width: undefined, + height: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "alt", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "This video cannot be displayed.", + }, + ], + }, + ], + }, + ], + }, + { + nodeName: "video-poster", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + props: undefined, + href: "sensei-video.jpg", + format: undefined, + scope: undefined, + id: undefined, + conref: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: undefined, + }, + { + nodeName: "media-source", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: "sensei-video.mp4", + format: undefined, + scope: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: undefined, + }, + { + nodeName: "media-source", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: "sensei-video.ogg", + format: undefined, + scope: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: undefined, + }, + { + nodeName: "media-source", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: "sensei-video.webm", + format: undefined, + scope: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: undefined, + }, + { + nodeName: "media-track", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: "sensei-video.vtt", + format: undefined, + scope: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + kind: undefined, + srclang: "en", + }, + children: undefined, + }, + ], + }, + { + nodeName: "example", + attributes: { + scale: undefined, + frame: undefined, + expanse: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + props: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "title", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "title", + }, + ], + }, + ], + }, + { + nodeName: "simpletable", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "title", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Table title", + }, + ], + }, + { + nodeName: "sthead", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "stentry", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + colspan: undefined, + rowspan: undefined, + scope: undefined, + headers: undefined, + }, + children: [ + { + nodeName: "p", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Header 1", + }, + ], + }, + ], + }, + { + nodeName: "stentry", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + colspan: undefined, + rowspan: undefined, + scope: undefined, + headers: undefined, + }, + children: [ + { + nodeName: "p", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Header 2", + }, + ], + }, + ], + }, + ], + }, + { + nodeName: "strow", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "stentry", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + colspan: undefined, + rowspan: undefined, + scope: undefined, + headers: undefined, + }, + children: [ + { + nodeName: "p", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Row 1, Cell 1", + }, + ], + }, + ], + }, + { + nodeName: "stentry", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + colspan: undefined, + rowspan: undefined, + scope: undefined, + headers: undefined, + }, + children: [ + { + nodeName: "p", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Row 1, Cell 2", + }, + ], + }, + ], + }, + ], + }, + { + nodeName: "strow", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "stentry", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + colspan: undefined, + rowspan: undefined, + scope: undefined, + headers: undefined, + }, + children: [ + { + nodeName: "p", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Row 2, Cell 1", + }, + ], + }, + ], + }, + { + nodeName: "stentry", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + colspan: undefined, + rowspan: undefined, + scope: undefined, + headers: undefined, + }, + children: [ + { + nodeName: "p", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Row 2, Cell 2", + }, + ], + }, + ], + }, + ], + }, + ], + }, + { + nodeName: "fig", + attributes: { + scale: undefined, + frame: undefined, + expanse: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + props: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "title", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Figure title", + }, + ], + }, + { + nodeName: "desc", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Figure description", + }, + ], + }, + { + nodeName: "image", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + href: "images/image.png", + format: undefined, + scope: undefined, + width: undefined, + height: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "alt", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + keyref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "alt text", + }, + ], + }, + ], + }, + ], + }, + { + nodeName: "note", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + type: "note", + }, + children: [ + { + nodeName: "p", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Note content", + }, + ], + }, + ], + }, + { + nodeName: "section", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "title", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Section title", + }, + ], + }, + { + nodeName: "p", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + id: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "text", + content: "Section content", + }, + ], + }, + ], + }, + { + nodeName: "div", + attributes: { + dir: undefined, + "xml:lang": undefined, + translate: undefined, + props: undefined, + outputclass: undefined, + class: undefined, + }, + children: [ + { + nodeName: "fn", + attributes: { + props: undefined, + dir: undefined, + "xml:lang": undefined, + translate: undefined, + conref: undefined, + outputclass: undefined, + class: undefined, + id: "footnote", + callout: undefined, + }, + children: undefined, + }, + ], + }, + ], + }, + ], + }, + ], +}; \ No newline at end of file