def handle_url(self, text): """Return a clickable url.""" url = text if text.startswith("http://"): text = text[7:] if text.endswith("/"): text = text[:-1] url = simplemarkdown.html_escape(url).replace('"', """) text = simplemarkdown.html_escape(text) return '<a href="{0}">{1}</a>'.format(url, text)
def handle_url(self, text): """Return a clickable url.""" url = text if text.startswith('http://'): text = text[7:] if text.endswith('/'): text = text[:-1] url = simplemarkdown.html_escape(url).replace('"', '"') text = simplemarkdown.html_escape(text) return '<a href="{0}">{1}</a>'.format(url, text)
def handle_shortcut(self, text): """Return the keystroke currently defined for the action.""" collection_name, action_name = text.split(None, 1) import actioncollectionmanager action = actioncollectionmanager.action(collection_name, action_name) seq = action.shortcut() key = seq.toString(QKeySequence.NativeText) or _("(no key defined)") return '<span class="shortcut">{0}</span>'.format(simplemarkdown.html_escape(key))
def handle_shortcut(self, text): """Return the keystroke currently defined for the action.""" collection_name, action_name = text.split(None, 1) import actioncollectionmanager action = actioncollectionmanager.action(collection_name, action_name) seq = action.shortcut() key = seq.toString(QKeySequence.NativeText) or _("(no key defined)") return '<span class="shortcut">{0}</span>'.format( simplemarkdown.html_escape(key))
def handle_image(self, filename): url = simplemarkdown.html_escape(filename).replace('"', '"') return '<img src="{0}" alt="{0}"/>'.format(url)
def handle_text(self, text): """Return text escaped, it will not be represented as HTML.""" return simplemarkdown.html_escape(text)
def format_link(name): """Make a clickable link to the page.""" title = simplemarkdown.html_escape(cache.title(name)) return '<a href="{0}">{1}</a>'.format(name, title)
def handle_image(self, filename): url = simplemarkdown.html_escape(filename).replace('"', """) return '<img src="{0}" alt="{0}"/>'.format(url)