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

Accept null as empty content for load and convert #1148

Conversation

abelsromero
Copy link
Member

Both empty and null String are accepted as valid for load/convert methods for safety.

  • Minor Javadoc fixed
  • Integrate WhenDocumentIsLoaded into WhenAsciiDocIsLoadedToDocument

Fixes #1146

Thank you for opening a pull request and contributing to AsciidoctorJ!

Please take a bit of time giving some details about your pull request:

Kind of change

  • Bug fix
  • New non-breaking feature
  • New breaking feature
  • Documentation update
  • Build improvement

Description

What is the goal of this pull request?

Simply adds some extra consistency and safety to load and convert methods.
There are also some javadoc fixes and test refactors.

How does it achieve that?
Adds additional validations in case of nulls.

Are there any alternative ways to implement this?
We could consider null an invalid value as now and try to fail with a user friendly message.
But semantically null and empty string are the same here imho.

Are there any implications of this pull request? Anything a user must know?
No, I think it should be unnoticed by most users.

Issue

If this PR fixes an open issue, please add a line of the form:

Fixes #Issue
Fixes #1146

Release notes

Please add a corresponding entry to the file CHANGELOG.adoc

@abelsromero abelsromero force-pushed the issue-1146-support-null-as-empty-document branch from 70695a3 to 0f1d49a Compare March 21, 2023 11:58
Both empty and null String are accepted as valid for load/convert methods
for safety.
* Minor Javadoc fixed
* Integrate WhenDocumentIsLoaded into WhenAsciiDocIsLoadedToDocument

Fixes asciidoctor#1146
@robertpanzer
Copy link
Member

Thank you!

@robertpanzer robertpanzer merged commit 6bd238b into asciidoctor:main Mar 21, 2023
@abelsromero abelsromero deleted the issue-1146-support-null-as-empty-document branch April 21, 2023 08:25
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.

Support null as an empty source
2 participants