Angelo Gladding
lahacker.net

dlv5vbq7lzlthol5 4b942a3185b37d00

angelo@lahacker.net

South Pasadena, California, United States currently feels like 84.53°F

Home CodemkdnCommits

Bringing all to date

by Angelo Gladding 09CEF88F29CC1A44

Changed Files

--- a/mkdn/inline/__init__.py

+++ b/mkdn/inline/__init__.py

            # "Reference", "AutoReference",            # "AutoMagnet",            # "Section", "Widow",-           # "StrongEm", "Strong", "Em", "Small", "Code",+           "StrongEm", "Strong", "Em", "Small", "Code",             "Link", "AutoLink", "WikiLink",            "Mention", "Tag",
     """      split_pattern = r"@[A-Za-z0-9.]+"-    pattern = r"@(?P<contact>[A-Za-z0-9.]+)"+    pattern = r"@(?P<person>[A-Za-z0-9.]+)"      def parse(self, match):         if self.parser.child.tag == "a":             self.parser.child.attrib["class"] = "h-card"             return f"@{match.groups()[0]}"         # TODO rel=tag for "entry" context-        contact = match.group("contact")-        self.parser.at_mentions.append(contact)-        return f"<a class=h-card href=/contacts/{contact}>{contact}</a>"-        # return E.A(contact, E.CLASS("h-card"), href=f"/contacts/{contact}")+        person = match.group("person")+        self.parser.at_mentions.append(person)+        return f"<a class=h-card href=/people/{person}>{person}</a>"+        # return E.A(person, E.CLASS("h-card"), href=f"/people/{person}")   class Tag(Inline):

--- a/tests.py

+++ b/tests.py

  def test_mention():     t("@jane went to town",-      "<p><a class=h-card href=/contacts/jane>jane</a> "+      "<p><a class=h-card href=/people/jane>jane</a> "       "went to town </p>")