Fix disappearing span tags inside code blocks #157
Merged
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.
Problem
The issue was reported in: aws/aws-toolkit-vscode#5732
When there is a closing
span
tag inside a code block or inline code, it currently disappears and is not rendered. This is caused by old code in mynah-ui that would do some pre-processing on the html contents and replace certain span elements before they were rendered. This causes any span tag to be replaced and removed before they are rendered and this leads to the bug described aboveSee for example how the following input is rendered currently:
Solution
To remove the old
keepHighlights
functionality.See an example card body that correctly renders the span tags after the fix:
And the test case from above with prompt input containing spans:
Tests
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.