mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-13 20:21:06 +01:00
.
This commit is contained in:
parent
93640e56be
commit
5551529a58
2 changed files with 1 additions and 21 deletions
|
|
@ -141,16 +141,8 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
|||
async getEnrichedDescription() {
|
||||
if (!this.metadata.hasDescription) return '';
|
||||
|
||||
const appendWithSeparator = (text, add) => {
|
||||
if (!add) return text;
|
||||
if (text) return `${text}\n<hr>\n${add}`;
|
||||
else return add;
|
||||
};
|
||||
|
||||
const { prefix, value, suffix } = await this.getDescriptionData();
|
||||
let fullDescription = prefix ?? '';
|
||||
fullDescription = appendWithSeparator(fullDescription, value);
|
||||
fullDescription = appendWithSeparator(fullDescription, suffix);
|
||||
const fullDescription = [prefix, value, suffix].filter(p => !!p).join('\n<hr>\n');
|
||||
|
||||
return await foundry.applications.ux.TextEditor.implementation.enrichHTML(fullDescription, {
|
||||
relativeTo: this,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue