Skip to content

Commit

Permalink
doc: extensions: Add support for space delimited shields
Browse files Browse the repository at this point in the history
In case an entry takes multiple shileds delimited by space, handle that
by moving to a list based parsing from string based parsing.

Signed-off-by: Chaitanya Tata <[email protected]>
  • Loading branch information
krish2718 authored and jukkar committed Dec 10, 2024
1 parent 651a723 commit c5d87ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/_extensions/table_from_rows.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ def _find_shields(shields: Dict[str, Set[str]], sample_data: dict):
if not extra_args_raw:
return

if isinstance(extra_args_raw, list):
extra_args = " ".join(extra_args_raw)
if isinstance(extra_args_raw, str):
extra_args = extra_args_raw.split()
else:
extra_args = extra_args_raw

shield_args = re.findall(r'SHIELD=(\S*)', extra_args)
shield_args = [re.split(r'=', arg)[1] for arg in extra_args if 'SHIELD=' in arg]
if not shield_args:
return

Expand Down

0 comments on commit c5d87ce

Please sign in to comment.