Skip to content

html_notes: sanitize_markdown passes raw markdown instead of converting to HTML #47

@wassimk

Description

@wassimk

Hey! First off — I'm in the middle of setting up this action for pco-payments and it's been a fantastic experience. The documentation is excellent, the rule composability is really well thought out, and the whole thing just clicks. Great work on this.

I ran into something I'm not sure about though. When using create_task with html_notes and the sanitize_markdown helper, the PR body markdown ends up rendered as raw text in Asana rather than rich HTML. Headings show as ##, bullet points as - , tables as pipe characters, backticks stay as backticks, etc.

Here's what it looks like in Asana:

Image

My rule looks like this:

- when:
    event: pull_request
    action: labeled
    label: 'create-asana-task'
    has_asana_tasks: false
  then:
    create_task:
      project: '1211523174665896'
      workspace: '1202585680506197'
      section: '1211533141102704'
      title: '{{clean_title pr.title}}'
      assignee: '{{map_github_to_asana (or pr.assignee pr.author)}}'
      html_notes: '<body>{{sanitize_markdown pr.body}}</body>'

My question: Is sanitize_markdown intended to just sanitize/escape the markdown and pass it through as-is? Or should it be converting markdown to HTML for use in html_notes? Am I using the wrong helper, or is there not yet a helper that does markdown → HTML conversion?

Ideally there'd be something like {{markdown_to_html pr.body}} that converts the PR body into proper HTML (<h2>, <strong>, <ul>, <table>, <code>, etc.) so Asana renders it as rich text. Since html_notes accepts HTML, the pieces are all there — it just needs the conversion step.

Thanks again for the great tool!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions