Skip to content
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

Fix text missing after HTML tags #5320

Merged
merged 10 commits into from
Oct 7, 2024

Conversation

compulim
Copy link
Contributor

@compulim compulim commented Oct 7, 2024

Fixes #5319.

Changelog Entry

Fixed

Description

Our HTML parsing and serialization logic only handle .children but not .childNodes. Thus, it is omitting text nodes.

When dealing with certain types of Markdown, the text may not be wrapped in <p>. For example,

Line 1

<br />
Line 2

Will be converted to HTML and "Line 2" is not wrapped in <p> and is a text node.

<p>Line 1</p><br />Line 2

Specific Changes

  • Updates serializeDocumentIntoString and useRenderMarkdownAsHTML to handle text nodes
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@compulim compulim marked this pull request as ready for review October 7, 2024 21:11
OEvgeny
OEvgeny previously approved these changes Oct 7, 2024
OEvgeny
OEvgeny previously approved these changes Oct 7, 2024
@compulim compulim merged commit 1d59ded into microsoft:main Oct 7, 2024
25 checks passed
@compulim compulim deleted the fix-markdown-after-html branch October 7, 2024 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some Markdown after HTML tags are not rendered
2 participants