Skip to content

Commit

Permalink
Doc: insert Unicode zero-width space character in :choices: output, t…
Browse files Browse the repository at this point in the history
…o be nice with browsers line-break insertion logic

Fixes OSGeo#10778
  • Loading branch information
rouault committed Sep 12, 2024
1 parent 63ed1ea commit a63ef82
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion doc/source/_extensions/configoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,14 @@ def render(self, app):
elif len(self.choices) == 1:
text += f"={self.choices[0]}: "
else:
text += f'=[{"/".join(self.choices)}]: '
# Insert Unicode zero-width space around separating forward slash,
# so that all browsers produce line breaks.
# Cf https://github.com/OSGeo/gdal/issues/10778
zero_width_space = "\u200b"
concatenated_choices = f"{zero_width_space}/{zero_width_space}".join(
self.choices
)
text += f"=[{concatenated_choices}]: "

para += nodes.strong(text, text)

Expand Down

0 comments on commit a63ef82

Please sign in to comment.