Skip to content

Commit

Permalink
Merge pull request #182 from nichtsfrei/replace_new_line_with_space
Browse files Browse the repository at this point in the history
replace newlines with space on interpreted tags
  • Loading branch information
nichtsfrei authored Mar 2, 2021
2 parents 679bd56 + ccb69ae commit ed84f73
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- legend on the middle left instead of middle bottom [170](https://github.com/greenbone/pheme/pull/170)
### Fixed
- just contain last element of reference type within references instead of all [180](https://github.com/greenbone/pheme/pull/180)
- throw error when trying to calculate next line on missing severity [181](https://github.com/greenbone/pheme/pull/181)
- replace newlines with space on interpreted tags [182](https://github.com/greenbone/pheme/pull/182)

[21.04-rc3]: https://github.com/greenbone/pheme/compare/v21.04-rc2...v21.04-rc3

Expand Down
8 changes: 4 additions & 4 deletions pheme/transformation/scanreport/gvmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import logging
import time

from typing import Dict, List
from typing import Dict, List, Optional


from pheme.transformation.scanreport.model import (
Expand All @@ -53,14 +53,14 @@ def measure(*args, **kwargs):
return measure


def __tansform_tags(item) -> List[Dict]:
def __tansform_tags(item) -> Optional[Dict[str, str]]:
if isinstance(item, str):
split = [i.split('=') for i in item.split('|')]
return {i[0]: i[1] for i in split if len(i) == 2}
return {i[0]: i[1].replace('\n', ' ') for i in split if len(i) == 2}
return None


def __group_refs(refs: List[Dict]) -> Dict:
def __group_refs(refs: Dict[str, str]) -> Dict:
refs_ref = {}
for ref in refs.get('ref', []):
if isinstance(ref, dict):
Expand Down

0 comments on commit ed84f73

Please sign in to comment.