mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Only markdownify $target if move.range exists.
This commit is contained in:
parent
c00bc4cad2
commit
95422bc985
1 changed files with 11 additions and 6 deletions
|
@ -99,14 +99,19 @@ def _markdownify_effect_text(move, effect_text, language=None):
|
|||
effect_text = effect_text.replace(
|
||||
u'$effect_chance',
|
||||
unicode(move.effect_chance),
|
||||
).replace(
|
||||
u'$target',
|
||||
_target_labels[move.range.targets > 1]
|
||||
).replace(
|
||||
u'$Target',
|
||||
_target_labels[move.range.targets > 1].capitalize()
|
||||
)
|
||||
|
||||
# "The target" vs "each target"; for Conquest, but hopefully main series
|
||||
# moves too eventually
|
||||
if hasattr(move, 'range'):
|
||||
effect_text = effect_text.replace(
|
||||
u'$target',
|
||||
_target_labels[move.range.targets > 1]
|
||||
).replace(
|
||||
u'$Target',
|
||||
_target_labels[move.range.targets > 1].capitalize()
|
||||
)
|
||||
|
||||
return MarkdownString(effect_text, session, language)
|
||||
|
||||
_target_labels = {
|
||||
|
|
Loading…
Reference in a new issue