Skip to content

Commit

Permalink
💄 Also consider newlines in item sheets
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAsel committed Jul 22, 2024
1 parent e32c578 commit fc03b36
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/components/Shop/ShopSheet/ArmorSheet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ const cleanDescription = (description: string) => {
finalString = finalString.replaceAll('<hr />', '<hr class="tw-my-2"/>');
return finalString.replace(cleanRegex, '');
finalString = finalString.replaceAll('\n', '<br style="display: block; margin-top: 0px;">');
return finalString.replaceAll(cleanRegex, '');
};
const openShopSheet = (id: number) => {
Expand Down
5 changes: 4 additions & 1 deletion src/components/Shop/ShopSheet/ItemSheet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ const cleanDescription = (description: string) => {
finalString = finalString.replaceAll('<hr />', '<hr class="tw-my-2"/>');
return finalString.replace(cleanRegex, '');
finalString = finalString.replaceAll('\n', '<br style="display: block; margin-top: 0px;">');
return finalString.replaceAll(cleanRegex, '');
};
const openShopSheet = (id: number) => {
const routeData = router.resolve({ name: 'item', query: { id: id } });
window.open(routeData.href, '_blank');
Expand Down
4 changes: 3 additions & 1 deletion src/components/Shop/ShopSheet/ShieldSheet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ const cleanDescription = (description: string) => {
finalString = finalString.replaceAll('<hr />', '<hr class="tw-my-2"/>');
return finalString.replace(cleanRegex, '');
finalString = finalString.replaceAll('\n', '<br style="display: block; margin-top: 0px;">');
return finalString.replaceAll(cleanRegex, '');
};
const openShopSheet = (id: number) => {
Expand Down
4 changes: 3 additions & 1 deletion src/components/Shop/ShopSheet/WeaponSheet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ const cleanDescription = (description: string) => {
finalString = finalString.replaceAll('<hr />', '<hr class="tw-my-2"/>');
return finalString.replace(cleanRegex, '');
finalString = finalString.replaceAll('\n', '<br style="display: block; margin-top: 0px;">');
return finalString.replaceAll(cleanRegex, '');
};
const openShopSheet = (id: number) => {
Expand Down

0 comments on commit fc03b36

Please sign in to comment.