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 disappearing span tags inside code blocks #157

Merged
merged 2 commits into from
Nov 7, 2024
Merged

Fix disappearing span tags inside code blocks #157

merged 2 commits into from
Nov 7, 2024

Conversation

ege0zcan
Copy link
Contributor

@ege0zcan ege0zcan commented Nov 7, 2024

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 above

See for example how the following input is rendered currently:

```
<span> span inside a codeblock </span>
```

`<span> span inside inline code </span>`

Screenshot 2024-11-07 at 11 20 56

Solution

To remove the old keepHighlights functionality.

See an example card body that correctly renders the span tags after the fix:

Screenshot 2024-11-07 at 11 24 00

And the test case from above with prompt input containing spans:

Screenshot 2024-11-07 at 11 44 08

Tests

  • I have tested this change on VSCode
  • I have tested this change on JetBrains

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

dogusata
dogusata previously approved these changes Nov 7, 2024
@Jurredr Jurredr added the bug Something isn't working label Nov 7, 2024
@Jurredr Jurredr marked this pull request as ready for review November 7, 2024 13:21
@Jurredr Jurredr requested a review from a team as a code owner November 7, 2024 13:21
@Jurredr
Copy link
Contributor

Jurredr commented Nov 7, 2024

image
Small issue spotted in follow ups, @dogusata is on it.

@Jurredr Jurredr merged commit dc939c2 into main Nov 7, 2024
1 check passed
@Jurredr Jurredr deleted the ege/bugFix branch November 7, 2024 14:01
@Jurredr
Copy link
Contributor

Jurredr commented Nov 7, 2024

Screenshot 2024-11-07 at 14 57 58 Screenshot 2024-11-07 at 14 57 48 All fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants