Ticket #317 (closed: fixed)
Use addHTML() as seldom as possible, esp. with system messages
| Reported by: | heuler06 | Owned by: | jojo |
|---|---|---|---|
| Priority: | normal | Component: | collection |
| Severity: | Keywords: | ||
| Cc: |
Description
Wiki syntax is not recognized in system messages. That's why I suggest that the messages will be parsed by the mediawiki parser if possible. Otherwise you have to use HTML syntax in the messages.
Change History
comment:2 Changed 23 months ago by heuler06
No, I think you got it right. I set a wiki link at MediaWiki:Coll-save collection text that wasn't a link on the special page. Maybe this message is not parsed now?
comment:3 Changed 23 months ago by jojo
Oh, ok, now I get you mean (I saw that you put some additional – most probably de.wikibooks.org-specific text – to the coll-save_collection_text message): This particular message is translated via wfMsgHtml() and then inserted to the special page (together other text) via addHTML() because the surrounding text contains a HTML <form> and is contained in some floating <div> element (the latter might be achievable with wikitext, but as far as I know, forms cannot be added via wikitext).
There are some more places in the extension code that use HTML text directly. If it's possible to replace these occurances (or at least minimize their amount) with pure wikitext, I'd be glad to do it because your use-case showed that it's preferable to have the parser always availableto allow better customization via changed system messages alone.
comment:4 Changed 23 months ago by jojo
- Summary changed from parse system messages to Use addHTML() as seldom as possible, esp. with system messages
comment:5 follow-up: ↓ 6 Changed 22 months ago by jojo
Recently I refactored the code to make use of templates instead of putting lots of addHTML() calls in the main code. Do you think this ticket can be closed after this change?
comment:6 in reply to: ↑ 5 Changed 22 months ago by heuler06
I don't know because I don't understand what you want to tell me. ;-)
If it is possible then to use Wiki ML it can be closed, of course. :) But if not it should not be closed. That's the only question for me.
comment:7 Changed 22 months ago by jojo
- Status changed from new to closed
- Resolution set to fixed
I replaced some more translation calls, so that wikitext is supported.
I think the messages that are left and that don't support wikitext, cannot be changed, because it would lead to conflicts with the surrounding HTML (which we can't do without).
So I'll set this to fixed now. Feel free to reopen if there is e.g. a concrete example where wikitext would be desirable, but cannot be used.

There are several strings in Collection.i18n.php that contain wikitext and are translated via wfMsg*() and then added to the OutputPage via addWikiText(). Others contain HTML (because of custom links with query parameters for example) and are translated via wfMsgHtml() and then added to the output via addHTML().
Maybe I didn't get it though: In this case what do you mean with "system messages"?