mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 06:26:13 +01:00
[Feature] Item Description Enrichment (#1666)
* Added enrichment for Ancestries and Communities * Fixed remainder * Bit of padding * Increased left padding
This commit is contained in:
parent
267de9a8cf
commit
56cc16b39a
53 changed files with 350 additions and 54 deletions
|
|
@ -496,6 +496,22 @@ export function htmlToText(html) {
|
|||
return tempDivElement.textContent || tempDivElement.innerText || '';
|
||||
}
|
||||
|
||||
export async function getFeaturesHTMLData(features) {
|
||||
const result = [];
|
||||
for (const feature of features) {
|
||||
if (feature) {
|
||||
const base = feature.item ?? feature;
|
||||
const item = base.system ? base : await foundry.utils.fromUuid(base.uuid);
|
||||
const itemDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
|
||||
item.system.description
|
||||
);
|
||||
result.push({ label: item.name, description: itemDescription });
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a simple flavor-less formula with only +/- operators, returns a list of damage partial terms.
|
||||
* All subtracted terms become negative terms.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue