microsoft / microsoft/BotFramework-WebChat

Configure Markdown engine using middleware pattern

Open
#1,601 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog feature-request p2
Dominant language
HTML
Stars
1.8k
Forks
1.6k
Avg merge
22h 58m
Merged PRs (30d)
2

Description

This gives us benefit of ease to chain Markdown-It (or other engines) with sanitize-html.

And also, allow devs to easily reuse our configuration of sanitize-html.

() => next => ({ contentType, text }) => {
  return next({
    contentType: 'text/html',
    text: MarkdownIt.render(markdown)
  });
}

We also need to make sure if the Markdown is not processed by the middleware, we should spit out text/plain instead. So no one can easily enable XSS accidentally.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, entry points, or tests are named. Start by locating the Markdown rendering and sanitize-html integration, then trace how rendered content is passed through the response pipeline. Done means Markdown engines can be chained as middleware, sanitize-html configuration can be reused, and unprocessed Markdown is returned as text/plain.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
security, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.