fix: excerpt now generated from body if not provided #280
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✨ Codu Pull Request 💻
Pull Request details:
Closes #259
Previously if the except text box was left blank the article would have no excerpt saved in the DB.
If the exceprt is not provided, This change will remove the markdown from the body and set the first 156 chars of the article as the default.
Note: I didnt populate the excerpt text box by default after clicking "Publish". This is to provide the user with the opportunity to write their own excerpt without having to delete the default one. Maybe this should be changed?
Any breaking changes
None
Associated Screenshots:
New article being written.
After clicking publish. Note no excerpt in text box
After clicking Publish again and navigating to Articles page. Note default excerpt generated
Second article being created
Excerpt populated
After clicking Publish again and navigating to Articles page. Note actual excerpt provided by user is used instead of default