Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Do Not Install #2567

Draft
wants to merge 40 commits into
base: master
Choose a base branch
from
Draft

Conversation

oleibman
Copy link
Contributor

@oleibman oleibman commented Feb 6, 2024

All my unimplemented changes. Not intended for install.

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.

Fixes # (issue)

Checklist:

  • I have run composer run-script check --timeout=0 and no errors were reported
  • The new code is covered by unit tests (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes

All my unimplemented changes. Not intended for install.
@oleibman oleibman marked this pull request as draft February 6, 2024 23:25
@coveralls
Copy link

coveralls commented Feb 6, 2024

Coverage Status

coverage: 96.887% (+0.1%) from 96.749%
when pulling 92a4c5e on oleibman:wordunimplemented2
into 1be7a80 on PHPOffice:master.

Better from a technical standpoint.

Pre-processing much simplified.

Some post-processing added because loadHTML preserveWhiteSpace=false does not work well.

Not-UTF8 html can now be loaded.

No need to surround snippets with body tag.
It's debatable, but allow unescaped ampersand and unknown charset.
JSON is used in exactly 2 places in the code and should not be used in either.

XMLWriter uses it to cast a float to string. Aside from being silly, this actually causes a problem in Shared/HtmlTest, where one of the results should be 4000 but is instead tested for 3999.9999... The error should have been immaterial (a simple cast will give the correct answer), but the test was wrong, insisting on an exact match for a floating point answer. It should use assertEqualsWithDelta. Next, the reason why JSON got it "wrong" was because the conversions in Shared/Converter use the wrong order of operations - multiplications should be performed before divisions to help avoid rounding problems, but Converter was doing the divisions first. All the conversions there are changed to multiply before dividing. Finally, Shared/Html checks for width units of points or pixels, but should check for inches and centimers as well.

Writer/Html outputs tracking properties as a JSON string for some unfathomable reason. It is changed to output each of the three (author, id, and date) as its own discrete property. Tests didn't actually confirm the value of the properties; they do now. Oh, yes, htmlspecialchars is needed for author and id, otherwise the html may wind up broken.

Some simple changes are made to TestHelperDOCX to avoid intermittent problems on Windows, and to make the code a little cleaner.
Nominally redundant, but makes things easier for Html Reader.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants