Skip to content

Add support for arbitrary post-rewriting middleware #24

@jamietanna

Description

@jamietanna

Currently, I have two main usecases in which my Micropub endpoint modifies the incoming request before saving it, which the latter of which would be quite key for me to move over:

  • Rewrite a twitter profile URL as an h-card:

          "Have you asked https://twitter.com/jamietanna?",
          "Have you asked <span class=\"h-card\"><a class=\"u-url\" href=\"https://twitter.com/jamietanna\">@jamietanna</a></span>?"),
    
  • Mark hashtags in the post as category properties in the post itself, with some custom rules:

    • i.e. #Java becomes java (just lowercase'd)
    • i.e. #SocialMedia becomes social-media (split words on capitalisation)
    • i.e. #IndieWeb becomes indieweb (custom rule)
    • i.e. #FOSDEM becomes fosdem (all caps get treated as one word)

(There are other cases, like "if I'm replying to Twitter, add a syndication link, but those are lower priority)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions