Skip to content

The 0.3.1 release - #44

Closed
fabeat wants to merge 18 commits into
mainfrom
release/0.3.1
Closed

fabeat wants to merge 18 commits into
mainfrom
release/0.3.1

Conversation

@fabeat

@fabeat fabeat commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

The changelog gains a heading for the version, which is what the release job reads the release notes out of, and a link reference for it.

The tag is the maintainer's to cut:

git tag -a v0.3.1 -m v0.3.1
git push origin refs/tags/v0.3.1

This release carries the patch that puts the documents in the order the schema names them, the templates written by the fixed library, the gate that keeps them there, and the link's run properties in the right order.

fabeat added 18 commits October 30, 2026 16:57
The properties of a hyperlink's run were written by hand, because PHPWord's
Link element holds one plain string and cannot carry a label with emphasis
in it. They were written in the order they came to mind: the weight, the
slant, the strike, the underline, the colour, the size and the typeface.

w:rPr is the sequence EG_RPrBase in ECMA-376's wml.xsd and not a set, so a
reader walks the children in the order they are written and stops at the
first one it did not expect. The typeface comes before the weight, and the
underline comes after the size, and a document that gets this wrong is one
Word refuses to open.

Microsoft's own validator reported "The element has unexpected child
element 'w:color'" nineteen times across the example documents, every one
of them a link whose label was styled. There are none of them now.
Two of them named a position in the schema's sequence, which is a number
that goes stale the moment the schema is read again, and one of them said
a run can hold every property, which is a claim about the schema rather
than about this library.
A `.docx` is Office Open XML, and a document that breaks the schema is a
document that is not what it claims to be. Word opens it anyway, because Word
is lenient where the schema is not, and nothing else in the suite could see it.

The validator is Microsoft's own — the one the Open XML SDK Productivity Tool
uses — and it is run over the examples: the whole corpus of documents this
library writes, built by `examples/build.php`. A gate over a selection is a
gate over the selection.

The test skips itself where the .NET SDK is not, and says what is missing; the
job that installs the SDK runs it where it is, so the gate cannot be skipped
there. A second test asks the validator about a document with an error in it,
which is what proves that the gate can fail.
Drawing a preview of each document's first page takes longer than everything
else the build does, and the gate that reads the documents wants the documents.

The previews are still emptied with the rest of `out/`: a preview of a
document that is no longer built is a picture of nothing, which is the same
thing the directory is emptied for.
The gate is red when it lands: over the twenty-nine documents the build
writes, Microsoft's validator reports a thousand and two errors, and with the
four fixes upstream in PHPWord's writer it reports a hundred and fifty-one, of
which forty-four belong to the three committed templates and eighty-eight to
PHPWord itself.
…e suite

The runner image ships a .NET SDK, so the test does not skip itself there and
the gate would have failed the test matrix over a document that is nobody's
business but the gate's — and the analysis job needs the test job to have
passed. The gate has a job of its own, with the SDK version the validator is
built for, and the other jobs leave the suite out.
…elease/0.3.1

# Conflicts:
#	composer.json
#	patches.lock.json
@sonarqubecloud

Copy link
Copy Markdown

@fabeat

fabeat commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator Author

Combined into #49, which carries this and the rest of the campaign in one pull request. Nothing is lost: the commits are in it, and the release notes are folded into the 0.3.1 section.

@fabeat fabeat closed this Oct 31, 2026
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.

1 participant