aboutsummaryrefslogtreecommitdiff
path: root/testdata
AgeCommit message (Collapse)Author
11 daysall: fix parsing literal paragraphShulhan
A line that start with one or more space will be considered as literal paragraph. Once literal line found it will end until an empty line.
2026-03-30all: move the sect anchor element to the rightShulhan
Previously, we try to fix the anchor position by using "flex-direction: row-reverse". This cause the formatted text inside title also become reversed. For example, == With `mono` Will rendered as mono With $ This is not as expected. This changes fix this by rendering the anchor on the right after title.
2026-03-26all: make the anchor symbol position on the right side of headersShulhan
In Asciidoctor, when `:sectanchors:` is set, the default anchor symbol position is absolute on the left side of heading text with block display option (the symbol located outside of box area of headers). In special case, this cause an overflow when the generated HTML are rendered inside flex with fixed height (the body is scrollable with empty content on bottom). This module changes the anchor symbol position to the right side of heading text to prevent scroll on such layout, without absolute position and normal inline layout.
2026-02-23testdata: add test for paragraph followed by unordered listShulhan
The asciidoctor behaviour will not recognize list that is not started by empty line, similar to our implementation.
2026-02-18all: fix parsing inline format with escaped characterShulhan
If the text inside the inline format contains escaped character, the parsing failed to find the closed character which cause the format is not rendered as expected.
2026-01-24all: add aria-label to the anchor when sectanchor enabledShulhan
The aria-label help user with screen reader to discern and navigate the anchor. Ref: https://dequeuniversity.com/rules/axe/4.11/link-name
2026-01-23all: update default CSS to asciidoctor v2.0.26Shulhan
2026-01-23all: use separate file with go:embed for default CSSShulhan
Using separate file allow tracking and modifying the style as needed.
2025-04-18all: disable generating HTML meta for "generator" in testsShulhan
The "generator" value will changes on each releases, so better to disable it to minimize noise during release commit.
2025-04-18Release asciidoctor-go v0.7.0 (2025-04-18)v0.7.0Shulhan
[NEW FEATURE] Support include directive inside block code. Example of block code with include directive, ---- ... include::file[] ... ---- [NEW FEATURE] Support document attribute "docdir" The "docdir" attribute contains the full path of the directory that contains the source document. By default it is set to the directory where the Document resided. [NEW FEATURE] Add default HTML stylesheet. The generated HTML now contains the default stylesheet. The stylesheet is copied from HTML file generated by Asciidoctor v2.0.23.
2025-04-18all: support include directive inside block codeShulhan
Example of block code with include directive, ---- ... include::file[] ... ----
2025-02-16all: support document attribute "docdir"Shulhan
The "docdir" attribute contains the full path of the directory that contains the source document. By default it is set to the directory where the Document resided.
2025-02-13testdata: redact the "Last updated" time in test-parser HTML filesShulhan
Every time we execute "make test-parser", the generated HTML files will changes the "Last updated xxx" (where xxx is the time its executed). This changes prevent this unnecessary diff in the future.
2025-02-13all: add default HTML stylesheetShulhan
The generated HTML now contains the default stylesheet. The stylesheet is copied from HTML file generated by Asciidoctor v2.0.23.
2025-02-13testdata: add test data for unordered list with custom marker "[none]"Shulhan
2025-02-13testdata: fix version number in test dataShulhan
2025-01-21all: fix section detected as paragraph after list and commentShulhan
Previously, given the following markup, ---- * Sub list + Sub list content. //}}} //{{{ == Sub 2 //}} ---- The section "Sub 2" will be parsed as paragraph instead of new section.
2025-01-06go.mod: update all dependencies and Go to version 1.23.4Shulhan
2024-12-08Release asciidoctor-go v0.6.1 (2024-12-08)v0.6.1Shulhan
=== Bug fixes * all: fix error log when failed to open included file:: The log use the wrong variable when printing path for failed include file. * all: fix reading include file when parent path is absolute:: Previously, if the parent document is opened using absolute path and it contains include directive, the included file will fail to read because the parent path is joined with current working directory.
2024-10-15all: group all image related method and functions into single fileShulhan
This is to make it easy to see how it parsed and how it written to HTML, make the code more searchable. While at it, add test for block image.
2024-10-13all: fix reading include file when parent path is absoluteShulhan
Previously, if the parent document is opened using absolute path and it contains include directive, the included file will fail to read because the parent path is joined with current working directory.
2024-09-07Release asciidoctor-go v0.6.0 (2024-09-07)v0.6.0Shulhan
=== Breaking changes * all: rename struct "AttributeEntry" to "DocumentAttribute" This is to make the struct is clear that it represent the document attribute. * all: rename struct "AttributeEntry" to "DocumentAttribute" This is to make the struct is clear that it represent the document attribute. * all: refactoring DocumentAttribute into struct Using struct limit the value to only string, while some attributes can be an integer value, for example "leveloffset". === New features * all: support document attribute "leveloffset" The ":leveloffset:" on document attribute allow increment or decrement the heading level on included files. Reference: https://docs.asciidoctor.org/asciidoc/latest/directives/include-with-leveloffset/ === Enhancements * all: use strict document header format Previously, an empty line before Document Title cause the parser stop parsing the document header, now an empty lines are skipped. Also document attribute can be place anywhere, either before or after title, and in between attributes; now it can be only placed after revision or author or title. * all: remove unnecessary TrimRight Each lines to be parsed has been trimmed on the first load, so there is no need to do it again, on some cases.
2024-08-16all: support document attribute "leveloffset"Shulhan
The ":leveloffset:" on document attribute allow increment or decrement the heading level on included files. Reference: https://docs.asciidoctor.org/asciidoc/latest/directives/include-with-leveloffset/
2024-08-12all: use strict document header formatShulhan
Previously, an empty line before Document Title cause the parser stop parsing the document header, now an empty lines are skipped. Also document attribute can be place anywhere, either before or after title, and in between attributes; now it can be only placed after revision or author or title.
2024-04-04Release asciidoctor-go v0.5.2 (2023-04-04)v0.5.2Shulhan
This release only contains chores. * all: replace module "share" with "pakakeh.go" The "share" module has been moved to new repository with new name at "https://sr.ht/~shulhan/pakakeh.go". For more information see the change logs at "pakakeh.go" module. * all: comply with linter recommendations Most of the code changes related to refactoring if-else witch switch statement. * all: replace if-else bytes.Equals with static string case comparisons Using string instead of [bytes.Equal] give code much more readable.
2024-03-05all: replace module "share" with "pakakeh.go"Shulhan
2023-12-10all: fix custom IDs on first section got replacedShulhan
Any custom ID on the first section always replaced with the subsection because, first, when detecting preamble we did not check for line with kind ID "[[...]]" an short ID "[#...]". Second, when parsing preamble we did not stop when we found line kind ID and short ID. This preamble thing is kind of annoying. We need to revisit again how to detect preamble, maybe not calling separate block parser, but making it linear as the default first child of parent element.
2023-12-09all: rewrite tests for ToHTML using [test.Data]Shulhan
2023-05-30all: handle custom marker in between unordered listShulhan
Given the following markup, [square] * item 1 [circle] ** item 2 The list on item 2 now start with `<div class="ulist circle">`.
2023-05-28all: add support for unordered list with '-'Shulhan
The unordered list item with hyphen ('-') cause too much confusion and inconsistency, nevertheless most of still use it. Case one, given the following markup, ``` - Item 1 + "A line of quote" -- Author ``` Is the "Author" the sub item in list or we are parsing author of quote paragraph? Case two, the writer want to write em dash (`&#8212;` in HTML Unicode) but somehow the editor wrap it and start in new line. As a reminder, the official documentation only recommend using hyphen for simple list item [1]. [1] https://docs.asciidoctor.org/asciidoc/latest/lists/unordered/#basic-unordered-list
2023-05-28all: fix rendering blockquote without attributionShulhan
Previously, in the htmlWriteBlockQuoteEnd, if attribution is set we add HTML tag <div> and close it later after we add citation. The issue is we did not check if attribution is true again when we add closing tag for div, which make the div above of blockquote get closed.
2023-03-02all: fix empty line printed on ToHTMLBody or ToHTMLEmbeddedShulhan
Given the following adoc, ---- = T ---- If we call ToHTMLBody, the output is ---- <div id="header"> <h1>T</h1> ---- This changes fix the empty line at the top.
2023-03-02all: handle empty preambleShulhan
If the document contains empty preamble do not output the HTML wrapper of it.
2023-03-02all: ignore parsing block image in paragraphShulhan
Previously, if we have block image in paragraph, we parse it as inline image but with invalid src, for example image::my.png[multi line] would be parsed as <img src=":imy.png" alt="multi line">. This is incorrect according to asciidoctor output.
2022-12-19all: update reference for preamble and add unit testShulhan
2022-12-19all: support multi line attribute valuesShulhan
If the attribute value end with backslash '\', the value continue to the next line.
2022-12-16all: detach parsing preamble from contentShulhan
This is to prevent empty preamble being rendered in HTML content.
2022-12-16all: fix the orders of generated HTML metaShulhan
The meta tags from original asciidoctor are ordered as viewport, generator, description, keywords, and then author. While at it remove empty style tag due to when testing we use empty.css not "stylesheet!".
2022-11-27all: implement inline macro for passthrough ("pass:")Shulhan
The inline passthrough "pass:" can be used to control the substitutions applied to a run of text. Ref: https://docs.asciidoctor.org/asciidoc/latest/pass/pass-macro/
2022-10-20all: implement macro "footnote:"Shulhan
Macro footnote grammar, ---- "footnote:" [ REF_ID ] "[" STRING "]" ---- In asciidoctor, footnote can be placed anywhere, even after WORD without space in between. The REF_ID, define the unique ID for footnote and can be used to reference the previous footnote. The first footnote with REF_ID, should have the STRING defined. The next footnote with the same REF_ID, should not have the STRING defined; if its defined, the STRING is ignored.
2022-09-05all: fix parsing list description inside include directiveShulhan
Previously, given the following include statements in the main document include::list_desc.adoc[] include::list_desc.adoc[] Where list_desc.adoc content is, Item 00:: + -- * Bullet 0 + Description 0. * Bullet 1 -- The first include is parsed correctly, but the second include is parsed as is.
2022-08-06Release asciidoctor-go v0.3.1 (2022-08-06)v0.3.1Shulhan
=== Chores * all: rewrite unit tests for inlineParser using test.Data * all: cleaning up codes * go.mod: update share to v0.40.0
2022-08-06all: rewrite unit tests for inlineParser using test.DataShulhan
Using string literal for testing string input that may contains backtick or double quote make the test code become unreadable and hard to modify. The test.Data help this by moving the input and expected output into a file that can we write as is.
2022-08-05go.mod: update share to v0.40.0Shulhan
This update fix some issues related to new line on test.Data.
2022-07-24all: sort the generated HTML meta by namesShulhan
The order of meta names are "author", "description", "generator", and then "keywords".
2022-07-24all: add default metadata "generator"Shulhan
The generator metadata contains the library name and its current version.
2022-07-24all: rename the HTML output for test-parserShulhan
The HTML output file from asciidoctor is renamed to test.exp.html, and HTML output file from this library is renamed to test.got.html. The test.html in testdata is generated from ciigo, when running "make serve-doc".
2022-07-24all: update README and SPECSShulhan
Link each supported features to their official document and add that link as Reference in the SPECS. Currently only checked and Document header.
2022-07-24all: register the license and copyright in .reuse/dep5Shulhan
For files that cannot be add the license header (either the files auto generated during test or the comment not supported), we register the license and copyright in the .reuse/dep5.
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.