Skip to content

Commit

Permalink
Merge pull request #1808 from UlrichB22/fix_itemlist
Browse files Browse the repository at this point in the history
Fix search result highlighting for itemlist macro
  • Loading branch information
RogerHaase authored Nov 20, 2024
2 parents b4ba765 + e1ac3f7 commit 2213072
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
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

0 comments on commit 2213072

Please sign in to comment.