Skip to content

Commit

Permalink
removed leading space in ref function in needuml.py (#1205)
Browse files Browse the repository at this point in the history
Try to solve #1204

---------

Co-authored-by: Daniel Woste <[email protected]>
  • Loading branch information
PhilipPartsch and danwos authored Aug 21, 2024
1 parent 1caf65d commit aa4b068
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sphinx_needs/directives/needuml.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def ref(
need_info = self.needs[need_id]
link = calculate_link(self.app, need_info, self.fromdocname)

need_uml = " [[{link} {content}]]".format(
need_uml = "[[{link} {content}]]".format(
link=link,
content=need_info.get(option, "") if option else text,
)
Expand Down
4 changes: 2 additions & 2 deletions tests/__snapshots__/test_needuml.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -1273,8 +1273,8 @@
'content_calculated': '''
@startuml

DC -> Marvel: [[../index.html#ST_001 Test story]]
Marvel --> DC: [[../index.html#ST_002 Different text to explain the story]]
DC -> Marvel: [[../index.html#ST_001 Test story]]
Marvel --> DC: [[../index.html#ST_002 Different text to explain the story]]
@enduml

''',
Expand Down
4 changes: 2 additions & 2 deletions tests/test_needuml.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ def test_needuml_jinja_func_ref(test_app, snapshot):
assert all_needumls == snapshot

html = Path(app.outdir, "index.html").read_text(encoding="utf8")
assert "Marvel: [[../index.html#ST_001 Test story]]" in html
assert "DC: [[../index.html#ST_002 Different text to explain the story]]" in html
assert "Marvel: [[../index.html#ST_001 Test story]]" in html
assert "DC: [[../index.html#ST_002 Different text to explain the story]]" in html

srcdir = Path(app.srcdir)
out_dir = srcdir / "_build"
Expand Down

0 comments on commit aa4b068

Please sign in to comment.