-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Support HTML-in-Markdown #5161
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Removes the redundant second changelog line
beyackle2
requested review from
a-b-r-o-w-n,
compulim,
cwhitten,
srinaath and
tdurnford
as code owners
May 2, 2024 23:50
compulim
reviewed
May 3, 2024
...oll-to-end-button-tab-order-js-scroll-to-end-button-should-have-correct-tab-order-1-snap.png
Outdated
Show resolved
Hide resolved
compulim
reviewed
May 3, 2024
This was referenced Oct 25, 2024
Open
Open
Open
Open
Open
Open
Open
Open
Open
This was referenced Nov 1, 2024
Open
Open
Open
Open
Open
Open
Open
Open
Open
Open
This was referenced Nov 8, 2024
Open
Open
Open
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changelog Entry
Breaking changes
styleOptions.markdownRenderHTML
tofalse
Added
Description
This enables rendering of HTML-based citations by porting our "better link" plug-in into a HTML mod. And providing a new
styleOptions
to disable this if needed.Design
Porting "better link" plugin to a HTML mod
Today, the "better link" is a Markdown-It plugin. It can only apply to Markdown links but not
<a>
.We are porting the "better link" into a HTML mod, so we can apply a few decorations to
<a>
in additional to Markdown links:aria-label
/title
(accessibility)<button>
(needed by citation)rel="noopener noreferer"
andtarget="_blank"
(security)In future, we can apply "better link" and sanitization with a BYO Markdown engine. Today, the BYO engine need to do these job themselves.
Output of
useRenderMarkdownAsHTML
Today,
useRenderMarkdownAsHTML
will emit<p>Hello, World!</p>
.As this HTML could be used in Adaptive Cards, and we are using CSS to apply "open in external" icon. We need to add a container around the emitted HTML to apply our CSS.
Tomorrow, it will emit
<div class="webchat__render-markdown"><p>Hello, World!</p></div>
.The
webchat__render-markdown
is a "lightweight" container with CSS ofdisplay: contents
.Specific Changes
styleOptions.markdownRenderHTML
and default totrue
useRenderMarkdownAsHTML
to emit HTML with a containerCHANGELOG.md
Review Checklist
Browser and platform compatibilities reviewedz-index
)Internationalization reviewed (strings, unit formatting)package.json
andpackage-lock.json
reviewed