Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👌 Make needtable titles more permissive #1102

Merged
merged 3 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sphinx_needs/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
""",
}

TITLE_REGEX = r'([\w]+) as "([\w ]+)"'
TITLE_REGEX = r'([^\s]+) as "([^"]+)"'


NEED_DEFAULT_OPTIONS: Dict[str, Any] = {
Expand Down
1 change: 1 addition & 0 deletions tests/doc_test/doc_needtable/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"github",
"value",
"unit",
"special-chars!",
]

needs_string_links = {
Expand Down
3 changes: 2 additions & 1 deletion tests/doc_test/doc_needtable/test_titles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ TEST Titles
.. spec:: need 3
:id: titles_003
:links: titles_001
:special-chars!: special-chars value

.. needtable::
:columns: id;title as "Headline" ;outgoing as "Links"; incoming as "To this need123";status;tags as "My Tags"
:columns: id;title as "Headline" ;outgoing as "Links"; incoming as "To this need123";status;tags as "My Tags";special-chars! as "Special Characters!"
:style: table
2 changes: 2 additions & 0 deletions tests/test_needtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,5 @@ def test_doc_needtable_titles(test_app):
html = Path(app.outdir, "test_titles.html").read_text()
assert '<th class="head"><p>Headline</p></th>' in html
assert '<th class="head"><p>To this need123</p></th>' in html
assert '<th class="head"><p>Special Characters!</p></th>' in html
assert '<td class="needs_special-chars!"><p>special-chars value</p></td>' in html
Loading