MacroList should only display one help entry when there are multiple macros defined that differ only by case
The MacroList macro should only display a single entry when multiple macros are defined that differ only in case.
As an example, the th:wiki:EmailProcessorMacro allows #Email
and #email
. This results in two entries in the list of macros generated by MacroList, [[email]]
and [[Email]]
. I briefly discussed this with the author in th:5713 (screen capture is shown there).
With my limited knowledge of Trac, I believe this is due to the two entries in get_macros.
def get_macros(self):
"""Yield the name of the macro based on the class name."""
yield 'email'
yield 'Email'
Would it be reasonable to alter MacroList so that only one help entry is displayed? Perhaps the header can show [[Email]] or [[email]]
followed by the help entry.
Change History
(8)
Summary: |
MacroList should be case insensitive → MacroList should only display one help entry when there are multiple macros defined that differ only by case
|
Milestone: |
→ next-minor-0.12.x
|
Keywords: |
bitesized added
|
Component: |
general → wiki system
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
Owner: |
set to Christian Boos
|
Milestone: |
next-minor-0.12.x → 0.12
|
I don't think assuming that macros whose name only differ in case are the same is a good idea.
We could, however, group them if the documentation strings are non-empty and identical, as this would be a reasonable condition that they operate the same. I would be +0 on that.
The
[[MacroList]]
macro is implemented intrac/wiki/macros.py
(in case you want to try to implement the change yourself :-).