Skip to content

Commit 6a3dc5a

Browse files
authored
Merge pull request #270 from ma10/revise-yaml2x-20241119
yaml2x: 複数条件の出力時にカッコを用いて条件のグループを明示する
2 parents 3986833 + 7c37981 commit 6a3dc5a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tools/yaml2x/a11y_guidelines/classes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ def summary(self, lang):
730730
return f'{self.procedure.id}{language_info[lang]["simple_pass_singular"]}'
731731

732732
simple_conditions = [cond.summary(lang) for cond in self.conditions if cond.type == 'simple']
733-
complex_conditions = [cond.summary(lang) for cond in self.conditions if cond.type != 'simple']
733+
complex_conditions = [f'({cond.summary(lang)})' for cond in self.conditions if cond.type != 'simple']
734734

735735
if self.type == 'and':
736736
summary_separator = language_info[lang]['and_separator']
@@ -743,7 +743,7 @@ def summary(self, lang):
743743

744744
if len(simple_conditions) > 1:
745745
simple_conditions = [cond.replace(language_info[lang]['simple_pass_singular'], '') for cond in simple_conditions]
746-
simple_summary = summary_separator.join(simple_conditions) + simple_pass
746+
simple_summary = f'{summary_separator.join(simple_conditions)}{simple_pass}'
747747
return f'{simple_summary}{summary_connector}{summary_connector.join(complex_conditions)}' if complex_conditions else simple_summary
748748
else:
749749
return summary_connector.join(simple_conditions + complex_conditions)

tools/yaml2x/yaml2json/yaml2json.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ def reRST_str(str, info, lang):
4747
halfwidth_chars = r'[\u0000-\u007F\uFF61-\uFFDC\uFFE8-\uFFEE]'
4848

4949
# Remove whitespaces between fullwidth chars
50-
text = re.sub(f'({fullwidth_chars})\s+({fullwidth_chars})', r'\1\2', text)
50+
text = re.sub(rf'({fullwidth_chars})\s+({fullwidth_chars})', r'\1\2', text)
5151

5252
# Remove whitespaces between halfwidth chars and full width chars
53-
text = re.sub(f'({fullwidth_chars})\s+({halfwidth_chars})', r'\1\2', text)
54-
text = re.sub(f'({halfwidth_chars})\s+({fullwidth_chars})', r'\1\2', text)
53+
text = re.sub(rf'({fullwidth_chars})\s+({halfwidth_chars})', r'\1\2', text)
54+
text = re.sub(rf'({halfwidth_chars})\s+({fullwidth_chars})', r'\1\2', text)
5555

5656
return text
5757

0 commit comments

Comments
 (0)