Add support for templates without replacements in jqueryMsg
The template parser in jqueryMsg expect a replacement after the templatename as per the syntax
templateContents
= twr:templateWithReplacement p:templateParam* { return twr.concat(p) } / t:templateName p:templateParam* { return p.length ? [ t, p ] : [ t ] }
templateWithReplacement
= t:templateName ":" r:replacement { return [ t, r ] }
replacement
= '$' digits:digits { return [ 'REPLACE', parseInt( digits, 10 ) - 1 ] }
This fails for {{GRAMMAR:genitive|{{SITENAME}}}} since genitive is not a replacement or not starting with a $. (grammar is yet to be supported by the parser.)
Attached patch resolves this by adding an option to templateContents like this:
templateContents
= twr:templateWithReplacement p:templateParam* { return twr.concat(p) } / twr:templateWithOutReplacement p:templateParam* { return twr.concat(p) } / t:templateName p:templateParam* { return p.length ? [ t, p ] : [ t ] }
(Did not commit this code and keeping patch here since core code is in 'slush' )
Version: 1.20.x
Severity: normal
Attached: