Skip to content

Commit

Permalink
Merge pull request #1561 from StarWarsFoundryVTT/text_editor_tags_1559
Browse files Browse the repository at this point in the history
fix(text): fix disappearing text
  • Loading branch information
wrycu authored Jun 12, 2024
2 parents 674af7a + debd470 commit 794f904
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
`1.901`
* Features:
* Added a sheet option to disable Force Pool on Rival and Nemesis actor sheets ([#1502](/~https://github.com/StarWarsFoundryVTT/StarWarsFFG/issues/1502))
* The importer will no longer include every source as a header element, making it easier to read
* Fixes:
* Fixed a bug where item qualities sometimes showed "you do not have permission to view this item" for non-GMs ([#1552](/~https://github.com/StarWarsFoundryVTT/StarWarsFFG/issues/1552))
* Fixed changing skill characteristics not working ([#1550](/~https://github.com/StarWarsFoundryVTT/StarWarsFFG/issues/1550))
* Skill descriptions are now properly imported ([#1551](/~https://github.com/StarWarsFoundryVTT/StarWarsFFG/issues/1551))
* Talents from species no longer multiply ranks when combined with purchased talents ([#1540](/~https://github.com/StarWarsFoundryVTT/StarWarsFFG/issues/1540))
* Fixed a bug where some text disappeared from descriptions ([#1559](/~https://github.com/StarWarsFoundryVTT/StarWarsFFG/issues/1559))
* Fixed a bug where paragraph tags did not properly result in new lines

`1.900`
* Features:
Expand Down
11 changes: 8 additions & 3 deletions modules/helpers/journal.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,14 @@ export function register_oggdude_tag_enricher() {
enricher: async (match, options) => {
let element = document.createElement("span");
element.classList.add("bold");
element.textContent = match[2];
return element;
}
});
CONFIG.TextEditor.enrichers.push({
pattern: /(\[P\])(.[^\[]*)/gm,
pattern: /(\[P\](?![p]))/gm,
enricher: async (match, options) => {
let element = document.createElement("p");
let element = document.createElement("br");
return element;
}
});
Expand All @@ -345,20 +346,23 @@ export function register_oggdude_tag_enricher() {
enricher: async (match, options) => {
let element = document.createElement("span");
element.classList.add("italic");
element.textContent = match[2];
return element;
}
});
CONFIG.TextEditor.enrichers.push({
pattern: /(\[H1\])(.[^\[]*)\[h1\]/gm,
enricher: async (match, options) => {
let element = document.createElement("h1");
element.textContent = match[2];
return element;
}
});
CONFIG.TextEditor.enrichers.push({
pattern: /(\[H2\])(.[^\[]*)\[h2\]/gm,
enricher: async (match, options) => {
let element = document.createElement("h2");
element.textContent = match[2];
return element;
}
});
Expand All @@ -373,7 +377,8 @@ export function register_oggdude_tag_enricher() {
CONFIG.TextEditor.enrichers.push({
pattern: /(\[H4\])(.[^\[]*)\[h4\]/gim,
enricher: async (match, options) => {
let element = document.createElement("h4");
let element = document.createElement("h3"); // h4 doesn't exist
element.textContent = match[2];
return element;
}
});
Expand Down
4 changes: 2 additions & 2 deletions modules/importer/import-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2223,9 +2223,9 @@ export default class ImportHelpers {

const text = sourceArray.map((s) => {
if (s?.$Page) {
return `<h4>Page ${s.$Page} - ${s._}</h4>`;
return `Page ${s.$Page} - ${s._}<br>`;
} else {
return `<h4>${s}</h4>`;
return `${s}<br>`;
}
});

Expand Down

0 comments on commit 794f904

Please sign in to comment.