Support rich text book descriptions #3880
Merged
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.
Brief summary
Add support for rich text in book descriptions (including matching and editing).
Which issue is fixed?
Fixes #1820, #3786
In-depth Description
This adds the following:
The following changes were made:
BookDetailsEdit.vue
andMatch.vue
text-area-with-label
withrich-text-editor
for the description field.RichTextEditor.vue
style="margin-top: 0; margin-bottom: 0.125em"
to the label. This was to make it more compatible withTextareaWithLabel
.blur
method to the editor. This is required byDetails.vue
.config
prop. It was moved intoVueTrix
.VueTrix.vue
enableBreakParagraphOnReturn
into the static initialization block (since it only does static initialization).defaultStyles.css
less-spacing
class to thep
andul
tags. I think the current spacing (1em both before and after each block element) is a bit too much.ViewEpisode.vue
andpages/item/_id/index.vue
trix.css
trix-content
class to inherit the line-height from the parent element.trix-content p
to modify how the editor renders thep
tags.defaultStyles.css
, because I thought the editor should be more compact than the displayed text, but please change it if you don't like it.BookFinder.js
runSearch
method, instead of the various providers.book.descriptionPlain
to store a fully tag-stripped version of the description.BookMatchCard.vue
. I'm not sure if this is really required - maybe it's not a big deal if the card shows some html tags.Book.js
descriptionPlain
to JSON outputs.Currently
description in the selected match inMatch.vue
. I'm not sure if what I did is the best way, and I'm not even sure it's really required (if we just usedescription
instead, the only difference would be that theCurrently
might show a few html tags - maybe not a big deal).htmlSanitizer.js
How have you tested this?