Skip to content

Conversation

tarleb
Copy link
Collaborator

@tarleb tarleb commented Nov 25, 2024

Description

Reduces the amount of implicit type conversions that happens during unmarshalling from Lua. This makes it safer to re-use pandoc AST elements without looping them through pandoc/Haskell.

@tarleb tarleb marked this pull request as draft November 25, 2024 09:19
@tarleb tarleb force-pushed the avoid-implicit-type-conversions branch 7 times, most recently from 56c1d73 to 6fe2889 Compare November 26, 2024 17:20
@tarleb tarleb force-pushed the avoid-implicit-type-conversions branch 2 times, most recently from 587eaf5 to 3a23485 Compare December 6, 2024 16:48
@tarleb tarleb marked this pull request as ready for review December 6, 2024 16:49
@tarleb tarleb force-pushed the avoid-implicit-type-conversions branch from 3a23485 to 864b2c7 Compare December 9, 2024 11:02
This allows to get reproducible output when running the filter multiple
times.
If the metadata object is modified in a filter, then it should be
returned, as otherwise the changes might be lost.

In the given case, the return wasn't necessary, because filters that act
only on `Meta` objects are handled specially, in that the filter
function is called directly, without doing an actual traversal via
`walk`. However, this can lead to unexpected bugs; explicitly returning
the modified Meta object is cleaner and more robust.
The `long` field of a caption can never be nil, but it can be an empty
list.
The `blocks` property of a Pandoc object should always contain an object
of type `Blocks`.
@tarleb tarleb force-pushed the avoid-implicit-type-conversions branch from 864b2c7 to 3a0dc9e Compare December 11, 2024 13:57
@tarleb
Copy link
Collaborator Author

tarleb commented Dec 11, 2024

This was discussed and approved out of band, so I'm merging it.

@tarleb tarleb merged commit 6de2ca7 into quarto-dev:main Dec 11, 2024
47 checks passed
@tarleb tarleb deleted the avoid-implicit-type-conversions branch December 11, 2024 14:00
@cscheid
Copy link
Collaborator

cscheid commented Dec 11, 2024

Thank you! This is very exciting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants