[xwiki-contrib/documentation] df223c: OP#126: {{image}} macro declares an "alt" paramete...
Branch: refs/heads/op-127-kebab-case-check Home: https://github.com/xwiki-contrib/documentation Commit: df223c4fe7dd32fa1b63ad8eecd0b9b7ff602ed4 https://github.com/xwiki-contrib/documentation/commit/df223c4fe7dd32fa1b63ad... Author: Vincent Massol <[email protected]> Date: 2026-09-04 (Fri, 04 Sep 2026) Changed paths: M documentation-test/documentation-test-docker/src/test/it/org/xwiki/contrib/documentation/test/docker/DocumentationIT.java M documentation-test/documentation-test-pageobjects/src/main/java/org/xwiki/contrib/documentation/test/po/DocumentationViewPage.java M documentation-ui/src/main/resources/DocApp/Code/ImageMacro.xml Log Message: ----------- OP#126: {{image}} macro declares an "alt" parameter but never uses it — rendered images fall back to file name (WCAG 2.2 SC 1.1.1) * The Image macro now passes its declared "alt" parameter on to the image syntax it generates. It is escaped for the generated syntax with $services.rendering.escape: the alt text becomes a quoted image parameter, so an unescaped double quote or closing square bracket in it would end that parameter and silently truncate the text. * An absent or empty alt emits no parameter at all, so nothing changes for a page that sets none (the renderer keeps falling back to the file name, which ImageMacroAltCheck already reports). * DocumentationIT gains a regression guard on the rendered alt attribute, its fixture carrying both characters that need escaping, and DocumentationViewPage a getContentImageAlt() accessor. * Verified: documentation-ui builds (xar:format/xar:verify clean) and DocumentationIT is 9/9 green; reverting only the macro makes the new test fail with alt "foo.png", which is the reported bug. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Commit: 8159edcf2d99e09cba382ee67aebf5265ef47a9f https://github.com/xwiki-contrib/documentation/commit/8159edcf2d99e09cba382e... Author: Vincent Massol <[email protected]> Date: 2026-09-04 (Fri, 04 Sep 2026) Changed paths: M documentation-xwikiorg/documentation-xwikiorg-api/src/main/java/org/xwiki/contrib/documentation/internal/xwikiorg/AttachmentNameCheck.java M documentation-xwikiorg/documentation-xwikiorg-api/src/main/java/org/xwiki/contrib/documentation/internal/xwikiorg/KebabNameValidator.java M documentation-xwikiorg/documentation-xwikiorg-api/src/main/java/org/xwiki/contrib/documentation/internal/xwikiorg/PageNameCheck.java M documentation-xwikiorg/documentation-xwikiorg-api/src/test/java/org/xwiki/contrib/documentation/internal/xwikiorg/AttachmentNameCheckTest.java M documentation-xwikiorg/documentation-xwikiorg-api/src/test/java/org/xwiki/contrib/documentation/internal/xwikiorg/KebabNameValidatorTest.java M documentation-xwikiorg/documentation-xwikiorg-api/src/test/java/org/xwiki/contrib/documentation/internal/xwikiorg/PageNameCheckTest.java Log Message: ----------- OP#127: The kebab-case check rejects valid names and proposes a name that means the opposite * Decide kebab-case validity with a pattern instead of round-tripping through toKebab(), so a name that is already lowercase and hyphen-separated is no longer reported as a kebab-case error just because it holds a stop word. The pattern also rejects the underscore, which toKebab() used to keep and which is not kebab-case. * Split the one check into three independent rules — kebab-case shape, stop words, documentation-type words — each with its own predicate, its own transformation and its own violation, so the proposed name only ever fixes the rule that was reported. Stop words are now a Warning of their own naming the words found, rather than an Error about kebab-case. * Remove the meaning-bearing words from STOP_WORDS: every negation ("no", "not", "cannot", …) and every direction or relation word ("above", "below", "before", "after", "up", "down", …). A name such as cannot-restore describes the opposite of restore, so no rule may ask an author to shorten one into the other. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Compare: https://github.com/xwiki-contrib/documentation/compare/df223c4fe7dd%5E...815... To unsubscribe from these emails, change your notification settings at https://github.com/xwiki-contrib/documentation/settings/notifications
participants (1)
-
XWiki Notifications