Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yaml2x: 複数条件の出力時にカッコを用いて条件のグループを明示する #270

Merged
merged 3 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tools/yaml2x/a11y_guidelines/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def summary(self, lang):
return f'{self.procedure.id}{language_info[lang]["simple_pass_singular"]}'

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

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

if len(simple_conditions) > 1:
simple_conditions = [cond.replace(language_info[lang]['simple_pass_singular'], '') for cond in simple_conditions]
simple_summary = summary_separator.join(simple_conditions) + simple_pass
simple_summary = f'{summary_separator.join(simple_conditions)}{simple_pass}'
return f'{simple_summary}{summary_connector}{summary_connector.join(complex_conditions)}' if complex_conditions else simple_summary
else:
return summary_connector.join(simple_conditions + complex_conditions)
Expand Down
6 changes: 3 additions & 3 deletions tools/yaml2x/yaml2json/yaml2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ def reRST_str(str, info, lang):
halfwidth_chars = r'[\u0000-\u007F\uFF61-\uFFDC\uFFE8-\uFFEE]'

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

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

return text

Expand Down
Loading