Skip to content

Commit

Permalink
Also fix it for roll outcomes
Browse files Browse the repository at this point in the history
  • Loading branch information
ben committed Oct 31, 2023
1 parent fd2a039 commit 18aa4e8
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/module/rolls/ironsworn-roll-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,17 @@ export class IronswornRollMessage {
if (this.roll.isMatch && moveOutcome?.['With a Match']?.Text)
moveOutcome = moveOutcome['With a Match']
if (moveOutcome) {
// Render the markdown here so we can strip the tables.
// We include oracle buttons in the chat message, no need to
// also spam the table contents.
ret.moveOutcome = enrichMarkdown(moveOutcome.Text).replace(
/<table>[\s\S]*<\/table>/gm,
''
)
// Get the rendered markdown here. If there are oracles, we strip
// out the tables, because there will be a button in the chat message.
// If no oracles, that table is probably important to the move
// (i.e. SF's "Repair" move), so we leave it in.
ret.moveOutcome = enrichMarkdown(moveOutcome.Text)
if (moveSystem.Oracles?.length > 0) {
ret.moveOutcome = ret.moveOutcome.replace(
/<table>[\s\S]*<\/table>/gm,
''
)
}
}
return ret
}
Expand Down

0 comments on commit 18aa4e8

Please sign in to comment.