Skip to content

Commit

Permalink
Escape docstrings with brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Sep 27, 2022
1 parent 9820ccc commit 9999b39
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dcargs/_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
Union,
)

import rich.markup

from . import _fields, _instantiators, _resolver
from . import _shtab as shtab
from . import _strings
Expand Down Expand Up @@ -296,6 +298,7 @@ def as_str(x: Any) -> Tuple[str, ...]:


def _rich_tag_if_enabled(x: str, tag: str):
x = rich.markup.escape(x)
return x if not USE_RICH else f"[{tag}]{x}[/{tag}]"


Expand Down

0 comments on commit 9999b39

Please sign in to comment.