Allow wiki markup in language macros

See also: AccessibleMoin, BieneAward2007

For best accessibility each language change should be marked with language macro, so that sreenreades can adapt the pronunciation accordingly. For example on a German wiki each Egnlish term should be marked with [[en(Egnlish term)]].

Adding inline markup for single words is easy using markup around the macro e.g '''[[he(עברית)]]''' however it is harder for a sentence in other language e.g. [[he(כמה מילים בעברית)]].

The suggestion is to allow some wiki markup in language macros, similar to the FootNote macro. For example: [[en(This ''is'' a '''text''' with /!\ markup)]].

Here's a patch for MoinMoin.macro._init_ (moin-1-6-main-4cfb61592fe4)

    def _m_lang(self, text):
        """ Set the current language for page content.
        
            Language macro are used in two ways:
             * [lang] - set the current language until next lang macro
             * [lang(text)] - insert text with specific lang inside page
        """
        if text:
            Parser = wikiutil.getParser(self.request, text)
            # XXX FIXME parser injects unwanted opening (closing missing!)
            # of paragraph <p class="line862">
            return wikiutil.renderText(self.request, Parser, text, line_anchors=False).replace('<p class="line862">', '')

        self.request.current_lang = self.name
        return ''


CategoryFeaturePatched

MoinMoin: FeatureRequests/MakeWikimarkupInLanguageMacrosAvailable (last edited 2007-10-29 19:19:11 by localhost)