Lazik10 / TwilightImperiumUltimate

This project helps players gather all possible information about the TI4 game and provides every tool needed for tracking or setting up the game.
https://www.ti4ultimate.com
GNU General Public License v3.0
4 stars 1 forks source link

Card generator doesn't reflect new line when I hit enter #61

Open Lazik10 opened 2 weeks ago

Lazik10 commented 2 weeks ago

Bug: Not much to say about this. The whole generator tool needs rework from scratch.

Note: Support html tags and get rid of the stupid system I came up with.

This will probably take a while, because it will take a lot of time and there are more important things on my list for now.

roberttaylor426 commented 2 days ago

Hi :wave:

Awesome work!

I'm curious, were the cards on your Cards page generated with your generator? If so, how do you achieve text in bold (e.g. Elect Player)? Is this bug saying you can't? :grin:

FYI there's a typo on the Minister of Antiquities card, it reads Minister of Antiques.

Lazik10 commented 1 day ago

Hi,

yes they were, but only the czech versions, english version was downloaded and exported from TTPG/TTS source files. If you end the sentence with ":" it should auto convert the sentence into bold one. It can be seen when you first load the page with the default example card.

It only works with action card type. It is because I hardcoded this only for that type. But this solution seems bad either way.

I am currently thinking about supporting HTML tags in the future, that would mean, that everyone could use them on the fly without any need of special algorithm for conversion. And there would be higher flexibility to create desired text.

I am currently also searching for different card templates for other card types and with "bleeding edge" or how it is called. When I collect everything that I need I will start reworking this feature completely so it is easier to use and provides more card types.

roberttaylor426 commented 1 day ago

Ok, understood, thanks!

Yeap supporting HTML tags, perhaps through a WYSIWYG editor, would certainly allow maximum flexibility. Just be careful that if you make use of embedded user-generated HTML, you're potentially opening the site up to XSS attacks in future. Not an issue at the moment I don't think, but it might become one if you allowed users to share the cards they'd generated.

A safer option might be to consider markdown or similar. I guess that should still give you the necessary flexibility (for example).

In any case, good luck with the project!