Hello,
I have been experimenting with the Moin 1.9 import functionality in Moin 2,
and there have been a couple of things that have caused problems.
The first one was related to a wiki that was migrated from another solution
where some of the links were badly specified in that solution. The resulting
links were therefore incorrect in Moin 1.9 but did not cause issues. However,
with the "moin import19" functionality in Moin2, the importer will crash upon
encountering them.
The issue here is that in src/moin/wikiutil.py, in WikiLinkAnalyzer.__call__,
the exception handling does not handle NotFound which can be raised by the
Werkzeug framework. This unhandled exception causes the crash and can be fixed
by adding the appropriate import...
from werkzeug.exceptions import NotFound
...and extending the types in the except clause:
try:
# find moin rule matching link and the corresponding variable mappings
rule, vars = self.map_adapter.match(link, return_rule=True)
except (NoMatch, NotFound, RoutingException):
return WikiLinkInfo(False)
The second problem is connected to the interpretation of links, where a
trailing question mark is discarded in Moin 2, whereas it is preserved in Moin
1.9 and encoded in any generated link. For example:
[[Test?|Test?]]
...is encoded as...
<a href="/Test%3F">Test?</a>
...in Moin 1.9. However, in Moin 2, the question mark is discarded, both
during the import process and also in any attempt to add it manually in the
wiki editor. It then becomes necessary to explicitly encode the link as
follows:
[[Test%3F|Test?]]
For content where pages may employ the question mark - such as frequently
asked questions - links may be written in the concise form and successfully
link to the appropriate page:
[[Test?]]
However, in Moin 2, this is not apparently possible, suggesting a change in
semantics, perhaps even a regression of sorts.
I hope this is useful feedback.
Paul