Skip to content

Test for irregular whitespaces - #1262

Merged
theletterf merged 8 commits into
mainfrom
test-irregular-whitespace
May 19, 2025
Merged

Test for irregular whitespaces#1262
theletterf merged 8 commits into
mainfrom
test-irregular-whitespace

Conversation

@theletterf

@theletterf theletterf commented May 16, 2025

Copy link
Copy Markdown
Member

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
Copy Markdown
Member 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.

@Mpdreamz Mpdreamz left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

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

@Mpdreamz Mpdreamz left a comment

Copy link
Copy Markdown
Member

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
@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