Skip to content

Test for irregular whitespaces #1262

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 8 commits into from
May 19, 2025
Merged

Test for irregular whitespaces #1262

merged 8 commits into from
May 19, 2025

Conversation

theletterf
Copy link
Contributor

@theletterf theletterf commented May 16, 2025

Irregular whitespaces, which are often inserted by mistake when using code editors, can break Markdown formatting. A way of mitigating this in VS Code is to use the Fix Irregular Whitespace extension, which detects and immediately edits these invisible characters.

This PR adds some irregular whitespace checking logic to the Markdown parser.

@theletterf theletterf requested a review from a team as a code owner May 16, 2025 08:59
@theletterf theletterf self-assigned this May 16, 2025
@theletterf
Copy link
Contributor Author

@Mpdreamz It seems we've tons of irregular whitespaces in docs-content... smoke tests are failing. I could confirm this by running a search from VSCode. https://github.com/elastic/docs-builder/actions/runs/15064731599/job/42346927067?pr=1262

Whether all those instances are problematic is to be seen. We could perhaps switch to a hint instead of a warning.

Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition @theletterf !

We should make this part of the markdown parser since it more efficiently reads the files and exposes the contents as Span<T>.

That way we don't do double reads. Happy to ammend this PR to move these checks over there.

Making it a HINT first seems like a good idea while we go over all the repositories to fix it.

@theletterf
Copy link
Contributor Author

Thanks! Happy if you'd do both changes, so I can learn 🙇🏻

Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@theletterf theletterf merged commit 9c1e5be into main May 19, 2025
14 checks passed
@theletterf theletterf deleted the test-irregular-whitespace branch May 19, 2025 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants