-
Notifications
You must be signed in to change notification settings - Fork 61
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
🐛 Fix tab-item label with nested syntax #135
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #135 +/- ##
=======================================
Coverage 89.97% 89.97%
=======================================
Files 11 11
Lines 948 948
=======================================
Hits 853 853
Misses 95 95
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Heya thanks for the PR, so your change relates to https://github.com/live-clones/docutils/blob/6de53a0de5415174d58e775110d89e13dd76fc83/docutils/docutils/nodes.py#L1129: class Element:
def __init__(self, rawsource='', text='', *children, **attributes):
if text != '':
textnode = Text(text)
Element.__init__(self, rawsource, textnode, *children,
**attributes)
else:
Element.__init__(self, rawsource, *children, **attributes) By adding the extra Do you have a "minimally reproducible example" of the problem? |
Not necessarily. When we call def test(rawsource = '', text = '', *children, **attributes):
print("text", text)
print(children)
lst = ["hello.1", "hello.2", "hello.3"]
test("", *lst)
'''
Outputs
text hello.1
('hello.2', 'hello.3')
'''
test("", "", *lst)
"""
Outputs
text
('hello.1', 'hello.2', 'hello.3')
""" Please let me know if this explanation is enough, or if you would still like me to provide minimally reproducible example of the initial issue. |
@chrisjsewell What do you think? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #135 +/- ##
==========================================
+ Coverage 89.15% 89.97% +0.82%
==========================================
Files 11 11
Lines 959 948 -11
==========================================
- Hits 855 853 -2
+ Misses 104 95 -9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great cheers, finally got round to this, and added a test case 👍
I'm not used to submitting pull requests so please excuse me if I've made any mistakes.
For my project, I had created a custom role which changed the color of specific words. Using such words in tab labels was not possible. I noticed in the code that the regions which did not allow this were missing arguments in
nodes.rubric
andsd_tab_label
, both of which arenodes.TextElement
.