microsoft / microsoft/BotFramework-WebChat
Configure Markdown engine using middleware pattern
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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