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

Suggestion: Omit fields given an empty array #56

Open
ajclaasen opened this issue Jun 24, 2020 · 0 comments
Open

Suggestion: Omit fields given an empty array #56

ajclaasen opened this issue Jun 24, 2020 · 0 comments

Comments

@ajclaasen
Copy link

Hello, thank you again for all of your hard work on this project.

I have a suggestion:

In textual data representations, empty arrays are often used to represent empty to-many relationships. (one such example)
A monster's immunities or reactions would be two cases of a to-many relationship. They can have anywhere between 0 and many immunities and/or reactions.
In vellum-monster, if an empty array is passed to a field expecting an array, such as immunities or reactions, it will still show the Immunities or Reactions text, even though they have no content.

My suggestion would be to hide these fields in the end result if the content passed to them is empty.

Given the following HTML:

<vellum-monster>
  hp="200"
  ac="18"
  immunities='[]'
  reactions='[]'
</vellum-monster>

Current outcome:

Hit Points 200
Armor Class 18
Damage Immunities

Reactions

Suggested outcome:

Hit Points 200
Armor Class 18

Thank you again for your work! Let me know what you think!

@ajclaasen ajclaasen changed the title Suggestions: Omit fields given an empty array Suggestion: Omit fields given an empty array Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants