| Age | Commit message (Collapse) | Author |
|
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.
|
|
The nolint tag is to ignore being linted by golangci-lint.
Since we are not using golangci-lint anymore, we can remove it.
|
|
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.
|
|
|
|
|
|
The golangci-lint does not output any results anymore
Either we are getting good at writing Go or the linter itself is become
less good.
We also have seen that the latest golangci-lint is failed to build
with Go tip, a simple "make" on the golangci-lint never success in my
experiences.
This changes fix all the output reported by the revive and shadow.
|
|
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.
|
|
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/
|
|
The idea is to move the parser to macro later so it can be reused by
html substitution.
|
|
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.
|
|
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.
|
|
Use raw string literal whenever possible.
|
|
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.
|
|
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.
|
|
|
|
Signed-off-by: Shulhan <ms@kilabit.info>
|
|
Previously, when parsing cross reference we assume that if the string
contains upper-case letter then it's a label so we store it as title
to search for ID later.
The bug is when ID is set manually and its contains upper-case for
example "[#Id]".
This changes fix this issue by storing cross reference first, not
assuming it as ID or title, and then when doing rendering we check
whether its ID or title.
|
|
If the em-dash strings "--" flanked by space, replace the space with
HTML symbol thin space.
|
|
This is to make it compatible with generated HTML from asciidoctor.
|
|
This is to allow the inline parser to pick it up as macro link.
|
|
Using prefix adoc to module asciidoc is kinda bit stutter.
|
|
Instead of parserX (or parser_x.go) we move the X as prefix so it will
become XParser (or x_parser.go).
|