PlayersCouncil / LotR-TCG_card_generator

nanDECK script for generating Lord of the Rings TCG cards from CSV.
6 stars 0 forks source link

New replacements needed #43

Open morvael opened 3 years ago

morvael commented 3 years ago

"'" may appear at start of text and at end of text. Please be aware they are symmetrical, the ending one can be IMHO detected by the fact that it usually follows a dot.

morvael commented 3 years ago

My solution:

Added after ";; Now for replacing regular quotes into smart quotes in the lore" comment:

;; replace 3/2 combos first
[lore_replaced] = REPLACE([lore_replaced],">\34\\34\'",">““‘")
[lore_replaced] = REPLACE([lore_replaced],"'\34\\34\<","’””<")
[lore_replaced] = REPLACE([lore_replaced],">\34\'\34\",">“‘“")
[lore_replaced] = REPLACE([lore_replaced],"\34\'\34\<","”’”<")
[lore_replaced] = REPLACE([lore_replaced],">\34\'",">“‘")
[lore_replaced] = REPLACE([lore_replaced],"'\34\<","’”<")
morvael commented 3 years ago

Also to support custom formatting using div tags (which allow to specify some css styles directly for the html renderer bypassing nandeck, add at the end of the replacement file:

;; allow div tags with style attribute in lore to work
[lore_replaced] = REPLACE([lore_replaced],"style=“","style=\34\")
[lore_replaced] = REPLACE([lore_replaced],"“>","\34\>")