sonar’s online scanner で、
Bad value “footnote” for attribute “rel” on element “a”: The string “footnote” is not a registered keyword. html-checker
Markdown の
Footnotes markup does not pass HTML5 validation · Issue #536 · vmg/redcarpet
HTML の
ブログの
注釈出力をoutput_format
を
class FootnotePattern(Pattern): """ InlinePattern for footnote markers in a document's body text. """ def __init__(self, pattern, footnotes): super(FootnotePattern, self).__init__(pattern) self.footnotes = footnotes def handleMatch(self, m): id = m.group(2) if id in self.footnotes.footnotes.keys(): sup = util.etree.Element("sup") a = util.etree.SubElement(sup, "a") sup.set('id', self.footnotes.makeFootnoteRefId(id, found=True)) a.set('href', '#' + self.footnotes.makeFootnoteId(id)) if self.footnotes.md.output_format not in ['html5', 'xhtml5']: a.set('rel', 'footnote') # invalid in HTML5 a.set('class', 'footnote-ref') a.text = util.text_type(self.footnotes.footnotes.index(id) + 1) return sup else: return None
output_format
の
output_format=html5
を指定する
def codehilite(content): """ Renders content using markdown with the codehilite extension. """ return _clean(markdown(content, ['codehilite',]), output_format="html5")
ちなみにxhtml1
です。
指定可能なoutput_format
の
Library Reference — Python Markdown
以上です。
コメント