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

Fix search result highlighting for itemlist macro #1808

Merged
merged 2 commits into from
Nov 20, 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
28 changes: 14 additions & 14 deletions src/moin/help/help-en/MoinWikiMacros.data
Original file line number Diff line number Diff line change
Expand Up @@ -366,30 +366,30 @@ the "startswith" parameter is more efficient than the equivalent "regex" express
{{{
Those items containing the string "Text" anywhere in the full path name:

<<ItemList(item="OtherTextItems", regex="Text")>>
<<ItemList(item="help-en/OtherTextItems", regex="Text")>>

Those items containing the string "Text" only in the descendent's name:

<<ItemList(item="OtherTextItems", regex="^.*/.*Text")>>
<<ItemList(item="help-en/OtherTextItems", regex="^.*/.*Text")>>

Those items containing a vowel as the 3rd-to-last character:

<<ItemList(item="OtherTextItems", regex="(?i)[aeiou].{2}$")>>
<<ItemList(item="help-en/OtherTextItems", regex="(?i)[aeiou].{2}$")>>
}}}

'''Result:'''

Those items containing the string "Text" anywhere in the full path name:

<<ItemList(item="OtherTextItems", regex="Text")>>
<<ItemList(item="help-en/OtherTextItems", regex="Text")>>

Those items containing the string "Text" only in the descendent's name:

<<ItemList(item="OtherTextItems", regex="^.*/.*Text")>>
<<ItemList(item="help-en/OtherTextItems", regex="^.*/.*Text")>>

Those items containing a vowel as the 3rd-to-last character:

<<ItemList(item="OtherTextItems", regex="(?i)[aeiou].{2}$")>>
<<ItemList(item="help-en/OtherTextItems", regex="(?i)[aeiou].{2}$")>>


===== The "display" parameter =====
Expand All @@ -402,19 +402,19 @@ displays the subitems of help-en/creole.
{{{
Displayed using "FullPath" (the default, see examples above):

<<ItemList(item="OtherTextItems", regex="PlainText", display="FullPath")>>
<<ItemList(item="help-en/OtherTextItems", regex="PlainText", display="FullPath")>>

Displayed using "ChildPath":

<<ItemList(item="OtherTextItems", regex="PlainText", display="ChildPath")>>
<<ItemList(item="help-en/OtherTextItems", regex="PlainText", display="ChildPath")>>

Displayed using "ChildName":

<<ItemList(item="OtherTextItems", regex="PlainText", display="ChildName")>>
<<ItemList(item="help-en/OtherTextItems", regex="PlainText", display="ChildName")>>

Displayed using "UnCameled":

<<ItemList(item="OtherTextItems", regex="PlainText", display="UnCameled")>>
<<ItemList(item="help-en/OtherTextItems", regex="PlainText", display="UnCameled")>>

Displayed using "ItemTitle":

Expand All @@ -425,19 +425,19 @@ Displayed using "ItemTitle":

Displayed using "FullPath":

<<ItemList(item="OtherTextItems", regex="PlainText", display="FullPath")>>
<<ItemList(item="help-en/OtherTextItems", regex="PlainText", display="FullPath")>>

Displayed using "ChildPath":

<<ItemList(item="OtherTextItems", regex="PlainText", display="ChildPath")>>
<<ItemList(item="help-en/OtherTextItems", regex="PlainText", display="ChildPath")>>

Displayed using "ChildName":

<<ItemList(item="OtherTextItems", regex="PlainText", display="ChildName")>>
<<ItemList(item="help-en/OtherTextItems", regex="PlainText", display="ChildName")>>

Displayed using "UnCameled":

<<ItemList(item="OtherTextItems", regex="PlainText", display="UnCameled")>>
<<ItemList(item="help-en/OtherTextItems", regex="PlainText", display="UnCameled")>>

Displayed using "ItemTitle":

Expand Down
10 changes: 5 additions & 5 deletions src/moin/help/help-en/MoinWikiMacros.meta
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"address": "127.0.0.1",
"comment": "",
"contenttype": "text/x.moin.wiki;charset=utf-8",
"dataid": "3783c3fdda3b43b1a4ec0f3300c22bdb",
"dataid": "63b9dec909e04f80938585644ae7d744",
"externallinks": [
"https://fontawesome.com/search?o=r&m=free",
"https://moinmo.in/HelpOnMacros/Include"
Expand All @@ -19,16 +19,16 @@
],
"itemtype": "default",
"language": "en",
"mtime": 1730231040,
"mtime": 1732105280,
"name": [
"MoinWikiMacros"
],
"name_old": [],
"namespace": "help-en",
"rev_number": 1,
"revid": "931016b31ee144e7879f2ab37ebc3caa",
"sha1": "d9c425e1ccc9d1a9d862b50ea46848558d6028cf",
"size": 14886,
"revid": "230f1f657b5d4725b5852f58e022309a",
"sha1": "7e9fe2f63fb8f7c171f86120fd48801cc58a9afd",
"size": 14998,
"summary": "",
"tags": [
"macros",
Expand Down
2 changes: 1 addition & 1 deletion src/moin/macros/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def create_pagelink_list(self, pagenames, alternative, ordered=False, display="F
url = str(iri.Iri(scheme="wiki", authority="", path="/" + fqname))

if display == "FullPath":
linkname = pagename
linkname = fqname
elif display == "ChildPath":
index = fqname.rfind("/")
if index == -1:
Expand Down