Repository navigation
Conversation
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.
…t the release measures
…elease/0.3.1 # Conflicts: # composer.json # patches.lock.json
…elease/0.3.1 # Conflicts: # composer.lock
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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:
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.