Context Navigation


Ticket #4356: trac_wiki_creole-r4428.patch

File trac_wiki_creole-r4428.patch, 2.9 KB (added by Christian Boos, 19 years ago)

Adapt Trac WikiFormatting to be more compatible with WikiCreole

  • trac/wiki/formatter.py

    152152
    153153 BOLDITALIC_TOKEN = "'''''"
    154154 BOLD_TOKEN = "'''"
    155(追記) BOLD_TOKEN_WC = r"\*\*" (追記ここまで)
    155156 ITALIC_TOKEN = "''"
    157(追記) ITALIC_TOKEN_WC = "//" (追記ここまで)
    156158 UNDERLINE_TOKEN = "__"
    157159 STRIKE_TOKEN = "~~"
    158160 SUBSCRIPT_TOKEN = ",,"
    182184 # Font styles
    183185 r"(?P<bolditalic>!?%s)" % BOLDITALIC_TOKEN,
    184186 r"(?P<bold>!?%s)" % BOLD_TOKEN,
    187(追記) r"(?P<bold_wc>!?%s)" % BOLD_TOKEN_WC, (追記ここまで)
    185188 r"(?P<italic>!?%s)" % ITALIC_TOKEN,
    189(追記) r"(?P<italic_wc>!?%s)" % ITALIC_TOKEN_WC, (追記ここまで)
    186190 r"(?P<underline>!?%s)" % UNDERLINE_TOKEN,
    187191 r"(?P<strike>!?%s)" % STRIKE_TOKEN,
    188192 r"(?P<subscript>!?%s)" % SUBSCRIPT_TOKEN,
    199203 r"(?P<citation>^(?P<cdepth>>(?: *>)*))",
    200204 # &, < and > to &amp;, &lt; and &gt;
    201205 r"(?P<htmlescape>[&<>])",
    206(追記) # [[macro]] call (追記ここまで)
    207(追記) (r"(?P<macro>!?\[\[(?P<macroname>[\w/+-]+)" (追記ここまで)
    208(追記) r"(\]\]|\((?P<macroargs>.*?)\)\]\]))"), (追記ここまで)
    202209 # wiki:TracLinks
    203210 r"(?P<shref>!?((?P<sns>%s):(?P<stgt>%s|%s(?:%s*%s)?)))" \
    204211 % (LINK_SCHEME, QUOTED_STRING,
    205212 SHREF_TARGET_FIRST, SHREF_TARGET_MIDDLE, SHREF_TARGET_LAST),
    206213 # [wiki:TracLinks with optional label] or [/relative label]
    207 (r"(?P<lhref>!?\[(削除) (削除ここまで)(?:"
    214 (r"(?P<lhref>!?\[(追記) \[? (追記ここまで)(?:"
    208215 r"(?P<rel>%s)|" % LHREF_RELATIVE_TARGET + # ./... or /...
    209 r"(?P<lns>%s):(?P<ltgt>%s|[^\]\s(削除) (削除ここまで)]*))" % \
    216 r"(?P<lns>%s):(?P<ltgt>%s|[^\]\s(追記) \| (追記ここまで)]*))" % \
    210217 (LINK_SCHEME, QUOTED_STRING) + # wiki:TracLinks or wiki:"trac links"
    211 r"(?:\s+(?P<label>%s|[^\]]+))?\])" % QUOTED_STRING), # optional label
    212 # [[macro]] call
    213 (r"(?P<macro>!?\[\[(?P<macroname>[\w/+-]+)"
    214 r"(\]\]|\((?P<macroargs>.*?)\)\]\]))"),
    218 r"(?:(?:\s+|\|)(?P<label>%s|[^\]]+))?\]\]?)" % QUOTED_STRING), # label
    215219 # == heading == #hanchor
    216220 r"(?P<heading>^\s*(?P<hdepth>=+)\s.*\s(?P=hdepth)\s*"
    217221 r"(?P<hanchor>#%s)?$)" % XML_NAME,
    302306
    303307 def _bold_formatter(self, match, fullmatch):
    304308 return self.simple_tag_handler(match, '<strong>', '</strong>')
    309(追記) # should be <b> (追記ここまで)
    305310
    311(追記) def _bold_wc_formatter(self, match, fullmatch): (追記ここまで)
    312(追記) return self.simple_tag_handler(match, '<b>', '</b>') (追記ここまで)
    313(追記) # should be <strong> (追記ここまで)
    314(追記) (追記ここまで)
    306315 def _italic_formatter(self, match, fullmatch):
    307316 return self.simple_tag_handler(match, '<i>', '</i>')
    308317
    318(追記) def _italic_wc_formatter(self, match, fullmatch): (追記ここまで)
    319(追記) return self.simple_tag_handler(match, '<em>', '</em>') (追記ここまで)
    320(追記) (追記ここまで)
    309321 def _underline_formatter(self, match, fullmatch):
    310322 return self.simple_tag_handler(match, '<span class="underline">',
    311323 '</span>')

AltStyle によって変換されたページ (->オリジナル) /