Skip to content

Commit

Permalink
Enriching contents item descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
brantai committed Nov 2, 2023
1 parent 2f6eac1 commit f13e542
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/module/item/nested-objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,13 @@ export async function getNestedItemData(nestedData) {

// Remember user selection & enrich description
itemData.selected = nestedData.selected
itemData.system.enrichedDescription = await TextEditor.enrichHTML(itemData?.system?.description, {
aync: true})

itemData.system.enrichedDescriptionUnrolled = await enrichHTMLUnrolled(itemData?.system?.description)

// Keep the quantity previously stored, if any
itemData.system.quantity = nestedData?.system?.quantity ?? itemData.system.quantity
// Keep the quantity previously stored, if any
itemData.system.quantity = nestedData?.system?.quantity ?? itemData.system.quantity

// Return only the data
// Warning: here the implicit assertion is that entity is an Item and not an Actor or something else
Expand Down
2 changes: 1 addition & 1 deletion src/templates/item/partial/item-contents.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{{#if content.system.description}}
<div class="row dlInfo" style="display: none; text-align: left">
<div class="col-12" style="padding: 2px 4px 4px;">
{{{content.system.description}}}
{{{content.system.enrichedDescription}}}
</div>
</div>
{{/if}}
Expand Down

0 comments on commit f13e542

Please sign in to comment.