Skip to content

fix: keep plain spaces in code, where MediaWiki makes them no-break - #834

Merged
lens0021 merged 2 commits into
mainfrom
fix/code-spaces
Oct 9, 2026
Merged

lens0021 merged 2 commits into
mainfrom
fix/code-spaces

Conversation

@lens0021

@lens0021 lens0021 commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Fixes #833

Inside <pre> and <code>, which also covers SyntaxHighlight's output, the rendered page now has a plain space wherever Sanitizer::armorFrenchSpaces had put U+00A0 (before !?:;%»› that is not followed by a word character, and after «‹). A new ParserOutputPostCacheTransform handler does it. Prose keeps its no-break spaces, and so does one in code that the rule did not write.

Tests: a unit test covers <pre>, <code>, SyntaxHighlight's YAML output and the &#160; form, plus prose and an author's no-break space left alone. An integration test runs core's parse and output pipeline on <pre>a != b</pre>, <code>a != b</code> and prose a !.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RALhBwbiZGrBpprRuUjAkK

Core's French spacing runs inside <pre> and <code> too, so the space
in `a != b` became U+00A0 and copied code carried it. The rendered
HTML now gets those spaces back inside code only. Prose keeps its
no-break spaces, and so does one in code that the rule did not write.

Fixes #833

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RALhBwbiZGrBpprRuUjAkK
lens0021 added a commit that referenced this pull request Oct 9, 2026
The required master jobs (phpunit, phan, coverage) fail on every branch
since core master's `ForeignAPIRepo::getThumbUrlFromCache()` started
taking a `ForeignAPIFile` instead of a name (`TypeError` in
`RetryingForeignRepoTest`, seen on #834). The override now names the
file from either argument, and the test passes whichever argument the
running core's signature takes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01RALhBwbiZGrBpprRuUjAkK

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to preview October 9, 2026 15:29 Destroyed
@lens0021
lens0021 merged commit 57d0661 into main Oct 9, 2026
27 checks passed
@lens0021
lens0021 deleted the fix/code-spaces branch October 9, 2026 15:30
lens0021 pushed a commit that referenced this pull request Oct 9, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.4.1](v1.4.0...v1.4.1)
(2026-10-09)


### Bugfixes

* keep plain spaces in code, where MediaWiki makes them no-break
([#834](#834))
([57d0661](57d0661))
* take the file MediaWiki 1.47 passes to a thumbnail lookup
([#835](#835))
([4bb50d9](4bb50d9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

This branch was successfully deployed

No deployments
preview — 02fef270 Deployed Oct 9, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code blocks carry a no-break space before ! ? : ; %, so copied code differs from the source

1 participant