Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failure to convert nested elements #739

Closed
gdamore opened this issue Aug 1, 2020 · 0 comments · Fixed by #740
Closed

failure to convert nested elements #739

gdamore opened this issue Aug 1, 2020 · 0 comments · Fixed by #740
Assignees
Milestone

Comments

@gdamore
Copy link
Collaborator

gdamore commented Aug 1, 2020

I have content that looks like:

`nng_socket_get()`::
This function is untyped and can be used to retrieve the value of any option.
The caller must store a pointer to a buffer to receive the value in _val_,
and the size of the buffer shall be stored at the location referenced by
_valszp_.
+
When the function returns, the actual size of the data copied (or that
would have been copied if sufficient space were present) is stored at
the location referenced by _valszp_.
If the caller's buffer is not large enough to hold the entire object,
then the copy is truncated.
Therefore the caller should check for truncation by verifying that the
returned size in _valszp_ does not exceed the original buffer size.
+
It is acceptable to pass `NULL` for _val_ if the value in _valszp_ is zero.
This can be used to determine the size of the buffer needed to receive
the object.
+
TIP: It may be easier to use one of the typed forms of this function.

When converting this, libasciidoc is tripped up by the new serializeParagraph code, which assumes that these are all RawLines. Because this contains some embedded stuff, we wind up with the following paragraphs actually being mishandled, as the content isn't a rawline, but rather a []interface{} (which is made up of raw lines I think):

unexpected type of element while serializing a paragraph: '[]interface {}'

It actually is tripping up on the thing following the first + sign.

@gdamore gdamore changed the title failure to convert nested elements (crash) failure to convert nested elements Aug 1, 2020
gdamore added a commit to gdamore/libasciidoc that referenced this issue Aug 1, 2020
@gdamore gdamore self-assigned this Aug 1, 2020
@gdamore gdamore added this to the v0.5.0 milestone Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant