aboutsummaryrefslogtreecommitdiff
path: root/document_parser_test.go
AgeCommit message (Collapse)Author
2022-07-24all: rewrite test using lib/test.DataShulhan
Previously, to test parser and check the generated HTML, we write AsciDoc input and expected HTML output using literal string `...`. The text of input and output sometimes long, take multiple lines, which makes the test code ugly, hard to write, and read. Using lib/test.Data we can write the input and output as the AsciiDoc markup and the HTML markup as is, simplify writing the test and more readable.
2022-07-17all: move Parse and parse functions to documentShulhan
Since the Parse return a *Document it should grouped into document.go to make the code consistent.
2022-07-17all: trim the right spaces on each line during parsing kind of lineShulhan
This is to prevent empty lines that contains only white spaces considered as non-empty line. While at it, fix typo in the comment.
2022-07-16all: reformat all Go filesShulhan
Replace any usage of ":=" with "var" declaration with type. The ideas is to make the code reader know what is the expected return value of function/method.
2022-07-16all: realign all structsShulhan
Minimize struct allocation, * columnFormat: from 40 to 16 bytes (-24 bytes) * document: from 400 to 392 bytes (-8 bytes) * element: from 312 to 264 bytes (-48 bytes) * elementAttribute: from 80 to 72 bytes (-8 bytes) * elementInclude: from 128 to 120 bytes (-8 bytes) * elementTable: from 88 to 64 bytes (-24 bytes) * inlineParser: from 64 to 40 bytes (-24 bytes) Plus all structs in the test files.
2022-02-21all: relicense the asciidoctor-go under GPL 3.0 or laterShulhan
Signed-off-by: Shulhan <ms@kilabit.info>
2021-04-06go.mod: set minimum Go version to 1.16 and update module share to v0.25.1Shulhan
The latest update on share v0.25.1 remove the last boolean parameter on lib/test.Assert().
2020-12-24document: rename ToEmbeddedHTML to ToHTMLEmbeddedShulhan
This is for consistency on exported method names on Document object. While at it, simplify the documentation for exported methods.
2020-12-20all: do not wrap document with content and preamble on ToEmbeddedHTMLShulhan
Previously, HTMl document generated from ToEmbeddedHTML contains div with id "content" and sub div "preamble". This changes, make the ToEmbeddedHTML generate the HTML document without those divs wrapper.
2020-12-20all: fix parsing list with open blockShulhan
If the list body contains continuation with open block, the whole open block content should be treatent as sub-of block until it end with "--".
2020-11-15all: add support for multiple authors with emailShulhan
2020-11-15all: add method ToEmbeddedHTMLShulhan
The ToEmbeddedHTML will generate the document content only, without header and footer.
2020-11-15all: parse the document subtitleShulhan
This changes also support different title separator using meta attribute "title-separator".
2020-11-15all: support setting document title through meta "doctitle"Shulhan