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

Search highlighting fails if page uses the ItemList macro #1807

Closed
UlrichB22 opened this issue Nov 20, 2024 · 0 comments · Fixed by #1808
Closed

Search highlighting fails if page uses the ItemList macro #1807

UlrichB22 opened this issue Nov 20, 2024 · 0 comments · Fixed by #1808
Assignees
Labels
bug Something isn't working macro

Comments

@UlrichB22
Copy link
Collaborator

When running a search e.g. for "itemlist" and opening the item help-en/MoinWikiMacros from the search results
(help-en/MoinWikiMacros?regex=itemlist) I am getting the following traceback in the server log:

2024-11-20 14:03:46,157 INFO moin.signalling.log:20 item MoinWiki:help-en/MoinWikiMacros displayed
2024-11-20 14:03:46,824 ERROR moin.items.content:316 An exception happened in _render_data (error_id = 855960e6-f8d1-4c11-b7a8-c793f7222c7b ):
Traceback (most recent call last):
  File "/mypath/src/moin/items/content.py", line 305, in _render_data
    doc = self._expand_document(doc)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mypath/src/moin/items/content.py", line 295, in _expand_document
    doc = highlight_conv(doc)
          ^^^^^^^^^^^^^^^^^^^
  File "/mypath/src/moin/converters/highlight.py", line 60, in __call__
    self.recurse(tree)
  File "/mypath/src/moin/converters/highlight.py", line 48, in recurse
    self.recurse(child)
  File "/mypath/src/moin/converters/highlight.py", line 48, in recurse
    self.recurse(child)
  File "/mypath/src/moin/converters/highlight.py", line 48, in recurse
    self.recurse(child)
  [Previous line repeated 5 more times]
  File "/mypath/src/moin/converters/highlight.py", line 34, in recurse
    if elem.tag.uri == moin_page.namespace:
       ^^^^^^^^
AttributeError: 'CompositeName' object has no attribute 'tag'

Additionally in help-en/MoinWikiMacros the namespace is missing for some ItemList examples with the item "OtherTextItems".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working macro
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant