{"action":"created","comment":{"url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/pulls/comments/83980002","pull_request_review_id":4786530,"id":83980002,"diff_hunk":"@@ -32,35 +35,45 @@ Function LogWrite\n    Add-content $Logfile -value \"$logstring\"\n }\n \n-# if original file name is a .doc file\n-$fileType = \".doc\"\n-If ($filenameSplit -eq $filename + $fileType)\n-{\n-\t# Converts a word .doc in bookmaker_tmp to a .docx\n-\t# so you have to have already run tmparchive.rb\n-\twrite-host \"Converting $filenameSplit to .docx from $fileType\"\n \n-\t$SaveFormat = \"microsoft.office.interop.word.WdSaveFormat\" -as [type]\n-\t$word = New-Object -ComObject word.application\n-\t$word.visible = $false\n+# Converts a word .doc in bookmaker_tmp to a .docx\n+# so you have to have already run tmparchive.rb\n+write-host \"Converting $filenameSplit to .docx from $fileType\"\n+\n+$SaveFormat = \"microsoft.office.interop.word.WdSaveFormat\" -as [type]\n+$word = New-Object -ComObject word.application\n+$word.visible = $false\n+\n+# Make sure \"Store random number...\" setting is off \n+$word.Options.StoreRSIDOnSave = $false\n+\n+$doc = $word.documents.open($docpath + $fileType)\n \n-\t$doc = $word.documents.open($docpath + $fileType)\n-\t$wdFormatDocx = 16  # wdFormatDocumentDefault is docx, reference number is 16\n+# turn off track changes, accept all changes and delete all comments\n+# have to do here, or we don't solve dumb XML revision problem\n+$doc.TrackRevisions = $false\n+$doc.Revisions.AcceptAll\n+Foreach($comment in $doc.Comments)","path":"htmlmaker_preprocessing.ps1","position":50,"original_position":50,"commit_id":"cd9eeac01297f39652e5465aec8299bb631d8294","original_commit_id":"cd9eeac01297f39652e5465aec8299bb631d8294","user":{"login":"ericawarren","id":7770929,"avatar_url":"https://avatars.githubusercontent.com/u/7770929?v=3","gravatar_id":"","url":"https://api.github.com/users/ericawarren","html_url":"https://github.com/ericawarren","followers_url":"https://api.github.com/users/ericawarren/followers","following_url":"https://api.github.com/users/ericawarren/following{/other_user}","gists_url":"https://api.github.com/users/ericawarren/gists{/gist_id}","starred_url":"https://api.github.com/users/ericawarren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericawarren/subscriptions","organizations_url":"https://api.github.com/users/ericawarren/orgs","repos_url":"https://api.github.com/users/ericawarren/repos","events_url":"https://api.github.com/users/ericawarren/events{/privacy}","received_events_url":"https://api.github.com/users/ericawarren/received_events","type":"User","site_admin":false},"body":"Ditto, can check `$doc.Comments.Count` if it throws an error","created_at":"2016-10-19T00:42:25Z","updated_at":"2016-10-19T00:44:26Z","html_url":"https://github.com/macmillanpublishers/bookmaker_addons/pull/101#discussion_r83980002","pull_request_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/pulls/101","_links":{"self":{"href":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/pulls/comments/83980002"},"html":{"href":"https://github.com/macmillanpublishers/bookmaker_addons/pull/101#discussion_r83980002"},"pull_request":{"href":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/pulls/101"}}},"pull_request":{"url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/pulls/101","id":89922692,"html_url":"https://github.com/macmillanpublishers/bookmaker_addons/pull/101","diff_url":"https://github.com/macmillanpublishers/bookmaker_addons/pull/101.diff","patch_url":"https://github.com/macmillanpublishers/bookmaker_addons/pull/101.patch","issue_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/issues/101","number":101,"state":"open","locked":false,"title":"Removing revision data from Word doc XML","user":{"login":"ericawarren","id":7770929,"avatar_url":"https://avatars.githubusercontent.com/u/7770929?v=3","gravatar_id":"","url":"https://api.github.com/users/ericawarren","html_url":"https://github.com/ericawarren","followers_url":"https://api.github.com/users/ericawarren/followers","following_url":"https://api.github.com/users/ericawarren/following{/other_user}","gists_url":"https://api.github.com/users/ericawarren/gists{/gist_id}","starred_url":"https://api.github.com/users/ericawarren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericawarren/subscriptions","organizations_url":"https://api.github.com/users/ericawarren/orgs","repos_url":"https://api.github.com/users/ericawarren/repos","events_url":"https://api.github.com/users/ericawarren/events{/privacy}","received_events_url":"https://api.github.com/users/ericawarren/received_events","type":"User","site_admin":false},"body":"UNTESTED and NOT ready to close. Opening PR so I can leave comments on the code in case @nelliemckesson or @mattretzer has time to test it in the next week; I can finish it next week if no one can get to it before next Tuesday.\r\n\r\nThis will fix @macmillanpublishers/bookmaker#128. See that issue for links to files for testing.\r\n\r\nTo test, you'll need to look at the Word doc's XML (either with Oxygen editor OR by saving as .zip). The revision data is added whenever revisions are made with Track Changes and then accepted. The original file will have a `<w:rsids>` element in `filename.docx!/word/settings.xml` (with a whole bunch of child elements for each revision). If the script works, the `<w:rsids>` element will be removed (and the `word/document.xml` file won't be a total disaster!).\r\n\r\nI'll add some comments to specific lines with some suggestions for troubleshooting.\r\n\r\nIt will need to be tested on files both with and without active track changes, and with and without comments. When it is working on its own, be sure to also test a bunch of different files in Bookmaker because there is a possibility it could affect htmlmaker.\r\n\r\nMight be worthwhile to also check for document protection here as well, and generate an error message to the submitter to remove doc protection and submit again.","created_at":"2016-10-19T00:25:38Z","updated_at":"2016-10-19T00:44:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f4c4904a2e0a8934716c36a14bcaff80ef8fb6a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/pulls/101/commits","review_comments_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/pulls/101/comments","review_comment_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/pulls/comments{/number}","comments_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/issues/101/comments","statuses_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/statuses/cd9eeac01297f39652e5465aec8299bb631d8294","head":{"label":"macmillanpublishers:norevisions","ref":"norevisions","sha":"cd9eeac01297f39652e5465aec8299bb631d8294","user":{"login":"macmillanpublishers","id":7340773,"avatar_url":"https://avatars.githubusercontent.com/u/7340773?v=3","gravatar_id":"","url":"https://api.github.com/users/macmillanpublishers","html_url":"https://github.com/macmillanpublishers","followers_url":"https://api.github.com/users/macmillanpublishers/followers","following_url":"https://api.github.com/users/macmillanpublishers/following{/other_user}","gists_url":"https://api.github.com/users/macmillanpublishers/gists{/gist_id}","starred_url":"https://api.github.com/users/macmillanpublishers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macmillanpublishers/subscriptions","organizations_url":"https://api.github.com/users/macmillanpublishers/orgs","repos_url":"https://api.github.com/users/macmillanpublishers/repos","events_url":"https://api.github.com/users/macmillanpublishers/events{/privacy}","received_events_url":"https://api.github.com/users/macmillanpublishers/received_events","type":"Organization","site_admin":false},"repo":{"id":36446410,"name":"bookmaker_addons","full_name":"macmillanpublishers/bookmaker_addons","owner":{"login":"macmillanpublishers","id":7340773,"avatar_url":"https://avatars.githubusercontent.com/u/7340773?v=3","gravatar_id":"","url":"https://api.github.com/users/macmillanpublishers","html_url":"https://github.com/macmillanpublishers","followers_url":"https://api.github.com/users/macmillanpublishers/followers","following_url":"https://api.github.com/users/macmillanpublishers/following{/other_user}","gists_url":"https://api.github.com/users/macmillanpublishers/gists{/gist_id}","starred_url":"https://api.github.com/users/macmillanpublishers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macmillanpublishers/subscriptions","organizations_url":"https://api.github.com/users/macmillanpublishers/orgs","repos_url":"https://api.github.com/users/macmillanpublishers/repos","events_url":"https://api.github.com/users/macmillanpublishers/events{/privacy}","received_events_url":"https://api.github.com/users/macmillanpublishers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/macmillanpublishers/bookmaker_addons","description":"Custom scripts and add-ons for Macmillan's Bookmaker toolchain","fork":false,"url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons","forks_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/forks","keys_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/teams","hooks_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/hooks","issue_events_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/issues/events{/number}","events_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/events","assignees_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/assignees{/user}","branches_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/branches{/branch}","tags_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/tags","blobs_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/git/refs{/sha}","trees_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/statuses/{sha}","languages_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/languages","stargazers_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/stargazers","contributors_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/contributors","subscribers_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/subscribers","subscription_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/subscription","commits_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/commits{/sha}","git_commits_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/git/commits{/sha}","comments_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/comments{/number}","issue_comment_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/issues/comments{/number}","contents_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/contents/{+path}","compare_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/merges","archive_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/downloads","issues_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/issues{/number}","pulls_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/pulls{/number}","milestones_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/milestones{/number}","notifications_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/labels{/name}","releases_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/releases{/id}","deployments_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/deployments","created_at":"2015-05-28T15:04:18Z","updated_at":"2016-01-20T20:07:47Z","pushed_at":"2016-10-19T00:25:38Z","git_url":"git://github.com/macmillanpublishers/bookmaker_addons.git","ssh_url":"git@github.com:macmillanpublishers/bookmaker_addons.git","clone_url":"https://github.com/macmillanpublishers/bookmaker_addons.git","svn_url":"https://github.com/macmillanpublishers/bookmaker_addons","homepage":null,"size":237,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":13,"forks":0,"open_issues":13,"watchers":0,"default_branch":"master"}},"base":{"label":"macmillanpublishers:master","ref":"master","sha":"ec0cce12108e4cfcd62d8fea36c2740988f2c15c","user":{"login":"macmillanpublishers","id":7340773,"avatar_url":"https://avatars.githubusercontent.com/u/7340773?v=3","gravatar_id":"","url":"https://api.github.com/users/macmillanpublishers","html_url":"https://github.com/macmillanpublishers","followers_url":"https://api.github.com/users/macmillanpublishers/followers","following_url":"https://api.github.com/users/macmillanpublishers/following{/other_user}","gists_url":"https://api.github.com/users/macmillanpublishers/gists{/gist_id}","starred_url":"https://api.github.com/users/macmillanpublishers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macmillanpublishers/subscriptions","organizations_url":"https://api.github.com/users/macmillanpublishers/orgs","repos_url":"https://api.github.com/users/macmillanpublishers/repos","events_url":"https://api.github.com/users/macmillanpublishers/events{/privacy}","received_events_url":"https://api.github.com/users/macmillanpublishers/received_events","type":"Organization","site_admin":false},"repo":{"id":36446410,"name":"bookmaker_addons","full_name":"macmillanpublishers/bookmaker_addons","owner":{"login":"macmillanpublishers","id":7340773,"avatar_url":"https://avatars.githubusercontent.com/u/7340773?v=3","gravatar_id":"","url":"https://api.github.com/users/macmillanpublishers","html_url":"https://github.com/macmillanpublishers","followers_url":"https://api.github.com/users/macmillanpublishers/followers","following_url":"https://api.github.com/users/macmillanpublishers/following{/other_user}","gists_url":"https://api.github.com/users/macmillanpublishers/gists{/gist_id}","starred_url":"https://api.github.com/users/macmillanpublishers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macmillanpublishers/subscriptions","organizations_url":"https://api.github.com/users/macmillanpublishers/orgs","repos_url":"https://api.github.com/users/macmillanpublishers/repos","events_url":"https://api.github.com/users/macmillanpublishers/events{/privacy}","received_events_url":"https://api.github.com/users/macmillanpublishers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/macmillanpublishers/bookmaker_addons","description":"Custom scripts and add-ons for Macmillan's Bookmaker toolchain","fork":false,"url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons","forks_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/forks","keys_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/teams","hooks_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/hooks","issue_events_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/issues/events{/number}","events_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/events","assignees_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/assignees{/user}","branches_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/branches{/branch}","tags_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/tags","blobs_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/git/refs{/sha}","trees_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/statuses/{sha}","languages_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/languages","stargazers_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/stargazers","contributors_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/contributors","subscribers_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/subscribers","subscription_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/subscription","commits_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/commits{/sha}","git_commits_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/git/commits{/sha}","comments_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/comments{/number}","issue_comment_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/issues/comments{/number}","contents_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/contents/{+path}","compare_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/merges","archive_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/downloads","issues_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/issues{/number}","pulls_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/pulls{/number}","milestones_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/milestones{/number}","notifications_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/labels{/name}","releases_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/releases{/id}","deployments_url":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/deployments","created_at":"2015-05-28T15:04:18Z","updated_at":"2016-01-20T20:07:47Z","pushed_at":"2016-10-19T00:25:38Z","git_url":"git://github.com/macmillanpublishers/bookmaker_addons.git","ssh_url":"git@github.com:macmillanpublishers/bookmaker_addons.git","clone_url":"https://github.com/macmillanpublishers/bookmaker_addons.git","svn_url":"https://github.com/macmillanpublishers/bookmaker_addons","homepage":null,"size":237,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":13,"forks":0,"open_issues":13,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/pulls/101"},"html":{"href":"https://github.com/macmillanpublishers/bookmaker_addons/pull/101"},"issue":{"href":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/issues/101"},"comments":{"href":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/issues/101/comments"},"review_comments":{"href":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/pulls/101/comments"},"review_comment":{"href":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/pulls/101/commits"},"statuses":{"href":"https://api.github.com/repos/macmillanpublishers/bookmaker_addons/statuses/cd9eeac01297f39652e5465aec8299bb631d8294"}}}}
{"actor":{"display_login":"ericawarren"}}