@@ -4009,6 +4009,8 @@ def _strip_nochords_blocks(self, text):
40094009 hideIntroChord : {start_chord} ... {end_chord}
40104010 hideBridge : {start_bridge} / {start_of_bridge} ... {end_bridge}
40114011 hideGrid : {start_of_grid} / {sog} / {grid} ... {end_of_grid}
4012+ hideTempo : {tempo_m} / {tempo_s} / {tempo_sp} / {tempo_c} / {tempo_cp}
4013+ hideTime : {time}
40124014 """
40134015 import re
40144016
@@ -4026,7 +4028,14 @@ def _strip_nochords_blocks(self, text):
40264028 open_tags .update (('start_of_grid' , 'sog' , 'grid' ))
40274029 close_tags .add ('end_of_grid' )
40284030
4029- if not open_tags :
4031+ # Tag singoli (direttive non-paired) da rimuovere riga per riga
4032+ single_tags = set ()
4033+ if getattr (self .pref , 'hideTempo' , False ):
4034+ single_tags .update (('tempo_m' , 'tempo_s' , 'tempo_sp' , 'tempo_c' , 'tempo_cp' ))
4035+ if getattr (self .pref , 'hideTime' , False ):
4036+ single_tags .add ('time' )
4037+
4038+ if not open_tags and not single_tags :
40304039 return text
40314040
40324041 # Regex che riconosce qualsiasi direttiva ChordPro: {tag} o {tag:label}
@@ -4045,6 +4054,8 @@ def _strip_nochords_blocks(self, text):
40454054 inside = True
40464055 depth = 1
40474056 # la riga di apertura viene scartata
4057+ elif tag in single_tags :
4058+ pass # riga con direttiva singola viene scartata
40484059 else :
40494060 result .append (line )
40504061 else :
0 commit comments