Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(text): fix disappearing text #1561

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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