Skip to content

Fix RoleParser #1536

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

Merged
merged 2 commits into from
Jul 8, 2025
Merged

Fix RoleParser #1536

merged 2 commits into from
Jul 8, 2025

Conversation

reakaleek
Copy link
Member

@reakaleek reakaleek commented Jul 7, 2025

Closes #1523

Context

Only in some cases (depending on the content length) the RoleParser would parse incorrect content.

E.g. if the icon is {icon}`pencil`, contentSpan would result in pencil` (a trailing space and trailing backtick)

The previous fix to this problem was just to add .Trim() to the existing contentSpan.Trim('`').

But this caused the trailing space to also disappear in the final HTML output, which was reported in #1523.

image

Changes

Fix the logic to determine the closing backtick.

Preview

Here you can see that the space is now correctly rendered in the final html output.

image

@reakaleek reakaleek self-assigned this Jul 7, 2025
@reakaleek reakaleek added the fix label Jul 7, 2025
@reakaleek reakaleek marked this pull request as ready for review July 7, 2025 22:03
@reakaleek reakaleek requested a review from a team as a code owner July 7, 2025 22:03
@reakaleek reakaleek requested a review from a team as a code owner July 7, 2025 22:08
Copy link

github-actions bot commented Jul 7, 2025

🔍 Preview links for changed docs

@reakaleek reakaleek mentioned this pull request Jul 8, 2025
@reakaleek reakaleek merged commit 47e4d24 into main Jul 8, 2025
17 checks passed
@reakaleek reakaleek deleted the feature/fix-role-parser branch July 8, 2025 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

some inline icons need more padding
2 participants