Add support for alt-text in preformatted blocks #15

Merged
cadey merged 5 commits from :alt-text into main 2021-09-08 13:30:32 +00:00
First-time contributor

⚠️ Breaking Change ⚠️

This adds support for parsing and rendering alt-text in preformatted blocks. This changes the public API both around the Node enum and the preformatted() method of the builder. I cannot think of a way to avoid this that is not needlessly overcomplicated, except maybe merging the preformatted & body into a single newline delimited string but that's hella gross and i don't think anyone wants that. Lemme know if you can think of a better way of doing this

Preformatted blocks without alt text can still be created by passing in an empty string. Because alt text isn't separated by a space, this does not add any unnecessary padding. I chose not to accept Option here because an empty string serves the same function but encourages users to use alt-text in their documents, which is very important for increasing accessibility.

⚠️ Breaking Change ⚠️ This adds support for parsing and rendering alt-text in preformatted blocks. This changes the public API both around the `Node` enum and the `preformatted()` method of the builder. I cannot think of a way to avoid this that is not needlessly overcomplicated, except maybe merging the preformatted & body into a single newline delimited string but that's hella gross and i don't think anyone wants that. Lemme know if you can think of a better way of doing this Preformatted blocks without alt text can still be created by passing in an empty string. Because alt text isn't separated by a space, this does not add any unnecessary padding. I chose not to accept Option<String> here because an empty string serves the same function but encourages users to use alt-text in their documents, which is very important for increasing accessibility.
Author
First-time contributor

#12 having been merged, this PR is good for review if you want

#12 having been merged, this PR is good for review if you want
Author
First-time contributor

Just realized that this broke several of the other workspace crates, and pushed an update to fix that. Also enabled CI on my fork and submitted #17 to help catch build errors in the future.

Just realized that this broke several of the other workspace crates, and pushed an update to fix that. Also enabled CI on my fork and submitted #17 to help catch build errors in the future.
cadey merged commit e9bcdf9f52 into main 2021-09-08 13:30:32 +00:00
Sign in to join this conversation.
No description provided.