tiddlywiki 5.3.8 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.json +34 -0
- package/.claude/settings.local.json +21 -0
- package/.gitattributes +4 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +62 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +8 -2
- package/.github/workflows/ci.yml +8 -8
- package/.github/workflows/eslint.yml +40 -0
- package/.github/workflows/pr-check-build-size.yml +2 -2
- package/.github/workflows/pr-comment-build-size.yml +1 -1
- package/.github/workflows/pr-validation.yml +37 -0
- package/bin/build-site.sh +1 -24
- package/bin/build-tw-org.sh +1 -1
- package/bin/optimise-svgs.js +32 -32
- package/boot/boot.js +112 -96
- package/boot/bootprefix.js +4 -0
- package/community/docs/Community Cards Caveats.tid +5 -0
- package/community/docs/Community Cards.tid +11 -0
- package/community/docs/Displaying Community Cards.tid +26 -0
- package/community/docs/Submitting a Community Card.tid +36 -0
- package/community/people/Arlen22.tid +10 -0
- package/community/people/ChristianByron.tid +14 -0
- package/community/people/EricShulman.tid +29 -0
- package/community/people/Jermolene.tid +21 -0
- package/community/people/LinOnetwo.tid +19 -0
- package/community/people/MotovunJack.tid +11 -0
- package/community/people/PMario.tid +25 -0
- package/community/people/SaqImtiaz.tid +16 -0
- package/community/people/kjharcombe.tid +7 -0
- package/community/project/TiddlyWiki People.tid +10 -0
- package/community/project/TiddlyWiki Project.tid +10 -0
- package/community/project/Vacant Positions.tid +4 -0
- package/community/project/teams/Core Team.tid +8 -0
- package/community/project/teams/Developer Experience Team.tid +19 -0
- package/community/project/teams/Infrastructure Team.tid +16 -0
- package/community/project/teams/MultiWikiServer Team.tid +8 -0
- package/community/project/teams/Project Team.tid +15 -0
- package/community/project/teams/Quality Assurance Team.tid +11 -0
- package/community/project/teams/Succession Team.tid +13 -0
- package/community/project/teams/TiddlyWiki Newsletter Team.tid +15 -0
- package/community/project/teams/tagCommunityTeam.tid +5 -0
- package/community/readme.md +3 -0
- package/community/tools/cards/DefaultColourMappings.multids +15 -0
- package/community/tools/cards/Procedures.tid +168 -0
- package/community/tools/cards/Styles.tid +158 -0
- package/community/tools/cards/ViewTemplateBodyCascade.tid +6 -0
- package/community/tools/cards/ViewTemplateBodyTemplatePerson.tid +3 -0
- package/community/tools/cards/ViewTemplateBodyTemplateTeam.tid +3 -0
- package/community/tools/icons/person.tid +7 -0
- package/community/tools/icons/project-team.tid +7 -0
- package/community/tools/icons/team.tid +9 -0
- package/contributing.md +1 -1
- package/core/acknowledgements.tid +1 -0
- package/core/language/en-GB/ControlPanel.multids +2 -1
- package/core/language/en-GB/Draft.multids +4 -0
- package/core/language/en-GB/Import.multids +2 -0
- package/core/language/en-GB/Misc.multids +1 -0
- package/core/language/en-GB/TiddlerInfo.multids +5 -0
- package/core/modules/background-actions.js +116 -0
- package/core/modules/editor/engines/framed.js +4 -4
- package/core/modules/editor/engines/simple.js +2 -1
- package/core/modules/editor/factory.js +11 -11
- package/core/modules/editor/operations/text/excise.js +1 -1
- package/core/modules/editor/operations/text/wrap-lines.js +1 -1
- package/core/modules/editor/operations/text/wrap-selection.js +1 -1
- package/core/modules/filter-tracker.js +106 -0
- package/core/modules/filterrunprefixes/cascade.js +2 -2
- package/core/modules/filterrunprefixes/filter.js +2 -2
- package/core/modules/filterrunprefixes/let.js +39 -0
- package/core/modules/filterrunprefixes/map.js +3 -3
- package/core/modules/filterrunprefixes/reduce.js +2 -2
- package/core/modules/filterrunprefixes/sort.js +3 -3
- package/core/modules/filters/compare.js +1 -1
- package/core/modules/filters/deserialize.js +1 -1
- package/core/modules/filters/each.js +2 -2
- package/core/modules/filters/field.js +1 -1
- package/core/modules/filters/fields.js +1 -1
- package/core/modules/filters/filter.js +1 -1
- package/core/modules/filters/format/json.js +2 -6
- package/core/modules/filters/format/timestamp.js +1 -1
- package/core/modules/filters/function.js +2 -2
- package/core/modules/filters/getindex.js +1 -1
- package/core/modules/filters/json-ops.js +71 -21
- package/core/modules/filters/lookup.js +1 -1
- package/core/modules/filters/math.js +29 -25
- package/core/modules/filters/range.js +4 -4
- package/core/modules/filters/removesuffix.js +1 -1
- package/core/modules/filters/strings.js +26 -80
- package/core/modules/filters/suffix.js +1 -1
- package/core/modules/filters/title.js +3 -2
- package/core/modules/filters/unknown.js +2 -2
- package/core/modules/filters/variables.js +1 -1
- package/core/modules/filters/x-listops.js +168 -168
- package/core/modules/filters.js +92 -45
- package/core/modules/indexers/back-indexer.js +8 -8
- package/core/modules/indexers/field-indexer.js +3 -3
- package/core/modules/info/dimensions.js +86 -0
- package/core/modules/info/mediaquerytracker.js +67 -0
- package/core/modules/info/platform.js +0 -7
- package/core/modules/keyboard.js +15 -16
- package/core/modules/macros/csvtiddlers.js +8 -9
- package/core/modules/macros/displayshortcuts.js +2 -2
- package/core/modules/parsers/audioparser.js +18 -8
- package/core/modules/parsers/binaryparser.js +1 -1
- package/core/modules/parsers/csvparser.js +8 -4
- package/core/modules/parsers/imageparser.js +6 -7
- package/core/modules/parsers/parseutils.js +274 -57
- package/core/modules/parsers/pdfparser.js +4 -5
- package/core/modules/parsers/videoparser.js +7 -8
- package/core/modules/parsers/wikiparser/rules/codeblock.js +5 -5
- package/core/modules/parsers/wikiparser/rules/commentblock.js +12 -3
- package/core/modules/parsers/wikiparser/rules/commentinline.js +9 -2
- package/core/modules/parsers/wikiparser/rules/conditional.js +1 -1
- package/core/modules/parsers/wikiparser/rules/emphasis/strikethrough.js +1 -1
- package/core/modules/parsers/wikiparser/rules/entity.js +0 -2
- package/core/modules/parsers/wikiparser/rules/extlink.js +2 -2
- package/core/modules/parsers/wikiparser/rules/fnprocdef.js +4 -4
- package/core/modules/parsers/wikiparser/rules/hardlinebreaks.js +3 -1
- package/core/modules/parsers/wikiparser/rules/html.js +10 -10
- package/core/modules/parsers/wikiparser/rules/image.js +1 -1
- package/core/modules/parsers/wikiparser/rules/import.js +0 -1
- package/core/modules/parsers/wikiparser/rules/list.js +1 -0
- package/core/modules/parsers/wikiparser/rules/macrocallblock.js +1 -1
- package/core/modules/parsers/wikiparser/rules/macrocallinline.js +2 -0
- package/core/modules/parsers/wikiparser/rules/macrodef.js +5 -3
- package/core/modules/parsers/wikiparser/rules/mvvdisplayinline.js +95 -0
- package/core/modules/parsers/wikiparser/rules/parsermode.js +8 -2
- package/core/modules/parsers/wikiparser/rules/prettyextlink.js +3 -1
- package/core/modules/parsers/wikiparser/rules/prettylink.js +1 -1
- package/core/modules/parsers/wikiparser/rules/rules.js +9 -2
- package/core/modules/parsers/wikiparser/rules/styleblock.js +4 -1
- package/core/modules/parsers/wikiparser/rules/styleinline.js +1 -1
- package/core/modules/parsers/wikiparser/rules/table.js +2 -2
- package/core/modules/parsers/wikiparser/rules/transcludeblock.js +5 -5
- package/core/modules/parsers/wikiparser/rules/transcludeinline.js +4 -4
- package/core/modules/parsers/wikiparser/rules/typedblock.js +24 -11
- package/core/modules/parsers/wikiparser/wikiparser.js +12 -12
- package/core/modules/pluginswitcher.js +4 -5
- package/core/modules/relinkers/tiddlers.js +54 -0
- package/core/modules/saver-handler.js +4 -4
- package/core/modules/savers/andtidwiki.js +6 -6
- package/core/modules/savers/custom.js +1 -1
- package/core/modules/savers/download.js +3 -1
- package/core/modules/savers/gitea.js +1 -2
- package/core/modules/savers/github.js +1 -3
- package/core/modules/savers/gitlab.js +3 -5
- package/core/modules/savers/postmessage.js +62 -0
- package/core/modules/savers/put.js +1 -1
- package/core/modules/savers/upload.js +1 -2
- package/core/modules/startup/browser-messaging.js +1 -1
- package/core/modules/startup/eventbus.js +46 -0
- package/core/modules/startup/favicon.js +10 -8
- package/core/modules/startup/info.js +10 -4
- package/core/modules/startup/load-modules.js +29 -1
- package/core/modules/startup/plugins.js +0 -1
- package/core/modules/startup/render.js +8 -3
- package/core/modules/startup/rootwidget.js +1 -1
- package/core/modules/startup/startup.js +1 -16
- package/core/modules/startup/windows.js +6 -4
- package/core/modules/storyviews/classic.js +5 -8
- package/core/modules/storyviews/pop.js +7 -11
- package/core/modules/storyviews/zoomin.js +17 -11
- package/core/modules/syncer.js +7 -7
- package/core/modules/upgraders/plugins.js +1 -2
- package/core/modules/upgraders/system.js +1 -2
- package/core/modules/upgraders/themetweaks.js +1 -2
- package/core/modules/utils/base64.js +31 -0
- package/core/modules/utils/csv.js +22 -22
- package/core/modules/utils/deprecated.js +58 -0
- package/core/modules/utils/diff-match-patch/diff_match_patch.js +2 -53
- package/core/modules/utils/diff-match-patch/diff_match_patch_uncompressed.js +826 -1615
- package/core/modules/utils/dom/browser.js +36 -22
- package/core/modules/utils/dom/dom.js +5 -54
- package/core/modules/utils/dom/dragndrop.js +5 -6
- package/core/modules/utils/dom/http.js +8 -9
- package/core/modules/utils/dom/keyboard.js +1 -1
- package/core/modules/utils/dom/modal.js +9 -10
- package/core/modules/utils/dom/notifier.js +0 -2
- package/core/modules/utils/dom/popup.js +6 -6
- package/core/modules/utils/dom/scroller.js +2 -2
- package/core/modules/utils/errors.js +1 -0
- package/core/modules/utils/escapecss.js +2 -88
- package/core/modules/utils/fakedom.js +4 -4
- package/core/modules/utils/linked-list.js +1 -1
- package/core/modules/utils/logger.js +1 -1
- package/core/modules/utils/messaging.js +121 -0
- package/core/modules/utils/parsetree.js +16 -0
- package/core/modules/utils/performance.js +3 -3
- package/core/modules/utils/pluginmaker.js +5 -5
- package/core/modules/utils/transliterate.js +2 -2
- package/core/modules/utils/utils.js +137 -158
- package/core/modules/widgets/action-confirm.js +1 -1
- package/core/modules/widgets/action-createtiddler.js +4 -4
- package/core/modules/widgets/action-listops.js +2 -4
- package/core/modules/widgets/action-log.js +17 -9
- package/core/modules/widgets/audio.js +101 -0
- package/core/modules/widgets/browse.js +1 -1
- package/core/modules/widgets/button.js +23 -11
- package/core/modules/widgets/checkbox.js +3 -3
- package/core/modules/widgets/data.js +1 -1
- package/core/modules/widgets/diff-text.js +27 -10
- package/core/modules/widgets/draggable.js +3 -3
- package/core/modules/widgets/droppable.js +3 -4
- package/core/modules/widgets/dropzone.js +21 -22
- package/core/modules/widgets/edit-binary.js +2 -3
- package/core/modules/widgets/edit-bitmap.js +0 -1
- package/core/modules/widgets/element.js +3 -1
- package/core/modules/widgets/eventcatcher.js +239 -80
- package/core/modules/widgets/fields.js +5 -5
- package/core/modules/widgets/genesis.js +1 -1
- package/core/modules/widgets/image.js +33 -9
- package/core/modules/widgets/importvariables.js +4 -3
- package/core/modules/widgets/jsontiddler.js +0 -1
- package/core/modules/widgets/keyboard.js +8 -9
- package/core/modules/widgets/let.js +6 -5
- package/core/modules/widgets/link.js +27 -13
- package/core/modules/widgets/linkcatcher.js +3 -3
- package/core/modules/widgets/list.js +12 -12
- package/core/modules/widgets/log.js +2 -2
- package/core/modules/widgets/messagecatcher.js +1 -1
- package/core/modules/widgets/navigator.js +29 -29
- package/core/modules/widgets/parameters.js +5 -2
- package/core/modules/widgets/password.js +1 -1
- package/core/modules/widgets/radio.js +1 -1
- package/core/modules/widgets/range.js +7 -21
- package/core/modules/widgets/reveal.js +33 -12
- package/core/modules/widgets/scrollable.js +4 -5
- package/core/modules/widgets/select.js +19 -10
- package/core/modules/widgets/setmultiplevariables.js +31 -31
- package/core/modules/widgets/slot.js +0 -1
- package/core/modules/widgets/testcase.js +1 -1
- package/core/modules/widgets/transclude.js +64 -32
- package/core/modules/widgets/void.js +23 -0
- package/core/modules/widgets/widget.js +179 -64
- package/core/modules/widgets/wikify.js +5 -5
- package/core/modules/wiki-bulkops.js +5 -41
- package/core/modules/wiki.js +45 -59
- package/core/palettes/BrightMute.tid +11 -6
- package/core/stylesheets/custom-properties.tid +30 -0
- package/core/templates/external-js/save-all-external-js.tid +1 -1
- package/core/templates/external-js/save-offline-external-js.tid +1 -1
- package/core/templates/external-js/tiddlywiki5-external-js.html.tid +8 -6
- package/core/templates/save-all.tid +1 -1
- package/core/templates/save-empty.tid +1 -1
- package/core/templates/save-lazy-all.tid +1 -1
- package/core/templates/save-lazy-images.tid +1 -1
- package/core/ui/AdvancedSearch/Filter.tid +23 -17
- package/core/ui/AdvancedSearch/Shadows.tid +9 -3
- package/core/ui/AdvancedSearch/Standard.tid +13 -7
- package/core/ui/AdvancedSearch/System.tid +9 -3
- package/core/ui/AlertTemplate.tid +3 -3
- package/core/ui/ControlPanel/Basics.tid +1 -0
- package/core/ui/EditTemplate/body-editor.tid +1 -1
- package/core/ui/EditTemplate/body-toolbar-button.tid +4 -2
- package/core/ui/EditTemplate/fields.tid +163 -139
- package/core/ui/EditTemplate/title.tid +5 -1
- package/core/ui/EditTemplate/type.tid +17 -2
- package/core/ui/Filters/StoryList.tid +1 -1
- package/core/ui/ImportListing.tid +35 -15
- package/core/ui/LayoutSwitcher.tid +18 -19
- package/core/ui/PageStylesheet.tid +2 -0
- package/core/ui/PageTemplate/alerts.tid +2 -2
- package/core/ui/SideBar/Open.tid +1 -1
- package/core/ui/SideBarSegments/search.tid +11 -5
- package/core/ui/TiddlerInfo/Advanced/CascadeInfo.tid +43 -0
- package/core/ui/TiddlerInfo.tid +1 -1
- package/core/ui/ViewTemplate/title.tid +7 -3
- package/core/ui/WikiInformation.tid +3 -0
- package/core/wiki/config/MediaQueryTrackers/DarkLightPreferred.tid +5 -0
- package/core/wiki/config/OfficialPluginLibrary.tid +1 -1
- package/core/wiki/config/TiddlerInfoMode.tid +1 -1
- package/core/wiki/languageswitcher.tid +12 -12
- package/core/wiki/macros/CSS-property.tid +39 -0
- package/core/wiki/macros/CSS.tid +0 -50
- package/core/wiki/macros/deprecated.tid +43 -0
- package/core/wiki/macros/keyboard-driven-input.tid +16 -10
- package/core/wiki/macros/list.tid +58 -43
- package/core/wiki/macros/tabs.tid +4 -3
- package/core/wiki/macros/tag-picker.tid +3 -2
- package/core/wiki/macros/toc.tid +32 -5
- package/core/wiki/minifocuseditswitcher.tid +8 -0
- package/core/wiki/tags/TiddlerInfoAdvanced.tid +1 -1
- package/core/wiki/themeswitcher.tid +10 -9
- package/core/wiki/viewswitcher.tid +5 -4
- package/core-server/commander.js +176 -0
- package/core-server/commands/commands.js +36 -0
- package/core-server/commands/deletetiddlers.js +36 -0
- package/core-server/commands/fetch.js +170 -0
- package/core-server/commands/import.js +42 -0
- package/core-server/commands/init.js +53 -0
- package/core-server/commands/listen.js +42 -0
- package/core-server/commands/load.js +44 -0
- package/core-server/commands/output.js +32 -0
- package/core-server/commands/render.js +63 -0
- package/core-server/commands/rendertiddlers.js +62 -0
- package/core-server/commands/save.js +62 -0
- package/core-server/commands/savetiddlers.js +49 -0
- package/core-server/commands/savewikifolder.js +221 -0
- package/core-server/commands/server.js +49 -0
- package/core-server/commands/setfield.js +50 -0
- package/core-server/filesystem.js +541 -0
- package/core-server/plugin.info +11 -0
- package/core-server/readme.tid +7 -0
- package/core-server/server/authenticators/basic.js +87 -0
- package/core-server/server/routes/delete-tiddler.js +26 -0
- package/core-server/server/routes/get-favicon.js +22 -0
- package/core-server/server/routes/get-file.js +73 -0
- package/core-server/server/routes/get-index.js +25 -0
- package/core-server/server/routes/get-login-basic.js +34 -0
- package/core-server/server/routes/get-status.js +31 -0
- package/core-server/server/routes/get-tiddler-html.js +42 -0
- package/core-server/server/routes/get-tiddler.js +44 -0
- package/core-server/server/routes/get-tiddlers-json.js +48 -0
- package/core-server/server/routes/put-tiddler.js +50 -0
- package/core-server/server/server.js +393 -0
- package/core-server/utils/base64.js +30 -0
- package/core-server/utils/escapecss.js +95 -0
- package/core-server/utils/repository.js +45 -0
- package/editions/de-AT/tiddlers/external/tiddlywiki.files +2 -2
- package/editions/de-AT/tiddlers/system/$__editions_de-AT-DE_download-empty.tid +1 -1
- package/editions/de-AT/tiddlywiki.info +1 -2
- package/editions/de-DE/tiddlywiki.info +1 -2
- package/editions/dev/tiddlers/$__StoryList.tid +3 -0
- package/editions/dev/tiddlers/How to Create a Custom Cascade Entry.tid +127 -0
- package/editions/dev/tiddlers/build/Releasing a new version of TiddlyWiki.tid +1 -0
- package/editions/dev/tiddlers/from Heigele and Jurke/RootWidget and Rendering Startup.tid +5 -1
- package/editions/dev/tiddlers/javascript-widget-tutorial/hello-attribute-optimized.js +1 -1
- package/editions/dev/tiddlers/javascript-widget-tutorial/tiddlerfield-norefresh.js +1 -1
- package/editions/dev/tiddlers/javascript-widget-tutorial/tiddlerfield.js +1 -1
- package/editions/dev/tiddlers/new/Using TiddlyWiki as a library.tid +1 -1
- package/editions/empty/tiddlywiki.info +1 -2
- package/editions/es-ES/tiddlers/system/download-empty.tid +1 -1
- package/editions/es-ES/tiddlywiki.info +1 -2
- package/editions/fr-FR/tiddlers/$__editions_tw5.com_railroad_macro-parameter-value.tid +3 -1
- package/editions/fr-FR/tiddlers/Macro_Call_Syntax.tid +1 -1
- package/editions/fr-FR/tiddlers/Macro_Definition_Syntax.tid +1 -1
- package/editions/fr-FR/tiddlers/ReleaseTemplate.tid +1 -0
- package/editions/fr-FR/tiddlers/community/resources/_savetiddlers_ Extension for Firefox by buggyj.tid +17 -0
- package/editions/fr-FR/tiddlers/system/download-empty.tid +1 -1
- package/editions/fr-FR/tiddlywiki.info +1 -2
- package/editions/ja-JP/tiddlers/Concatenating a text reference to create a URL.tid +15 -0
- package/editions/ja-JP/tiddlers/Concatenating variables to create a URL.tid +15 -0
- package/editions/ja-JP/tiddlers/TiddlyWiki Docs PR Maker.tid +4 -5
- package/editions/ja-JP/tiddlers/Welcome.tid +10 -0
- package/editions/ja-JP/tiddlers/_TiddlyStudy_ by Kebi.tid +28 -0
- package/editions/ja-JP/tiddlers/_tw_shared/doc-utilities/wikitext-macros.tid +91 -0
- package/editions/ja-JP/tiddlers/about/Archive.tid +3 -3
- package/editions/ja-JP/tiddlers/about/Developers.tid +3 -21
- package/editions/ja-JP/tiddlers/about/Donations.tid +17 -0
- package/editions/ja-JP/tiddlers/about/Funding TiddlyWiki.tid +1 -1
- package/editions/ja-JP/tiddlers/about/History of TiddlyWiki.tid +7 -81
- package/editions/ja-JP/tiddlers/about/The Story of TiddlyWiki.tid +71 -0
- package/editions/ja-JP/tiddlers/about/TiddlyWiki Anniversaries.tid +33 -0
- package/editions/ja-JP/tiddlers/commands/BuildCommand.tid +13 -0
- package/editions/ja-JP/tiddlers/commands/ClearPasswordCommand.tid +6 -0
- package/editions/ja-JP/tiddlers/commands/Commands.tid +17 -0
- package/editions/ja-JP/tiddlers/commands/CommandsCommand.tid +10 -0
- package/editions/ja-JP/tiddlers/commands/DeleteTiddlersCommand.tid +9 -0
- package/editions/ja-JP/tiddlers/commands/EditionsCommand.tid +10 -0
- package/editions/ja-JP/tiddlers/commands/FetchCommand.tid +10 -0
- package/editions/ja-JP/tiddlers/commands/HelpCommand.tid +10 -0
- package/editions/ja-JP/tiddlers/commands/ImportCommand.tid +10 -0
- package/editions/ja-JP/tiddlers/commands/InitCommand.tid +14 -0
- package/editions/ja-JP/tiddlers/commands/ListenCommand.tid +12 -0
- package/editions/ja-JP/tiddlers/commands/LoadCommand.tid +10 -0
- package/editions/ja-JP/tiddlers/commands/MakeLibraryCommand.tid +12 -0
- package/editions/ja-JP/tiddlers/commands/OutputCommand.tid +10 -0
- package/editions/ja-JP/tiddlers/commands/PasswordCommand.tid +6 -0
- package/editions/ja-JP/tiddlers/commands/RenderCommand.tid +18 -0
- package/editions/ja-JP/tiddlers/commands/RenderTiddlerCommand.tid +9 -0
- package/editions/ja-JP/tiddlers/commands/RenderTiddlersCommand.tid +9 -0
- package/editions/ja-JP/tiddlers/commands/SaveCommand.tid +10 -0
- package/editions/ja-JP/tiddlers/commands/SaveTiddlerCommand.tid +10 -0
- package/editions/ja-JP/tiddlers/commands/SaveTiddlersCommand.tid +10 -0
- package/editions/ja-JP/tiddlers/commands/SaveWikiFolderCommand.tid +9 -0
- package/editions/ja-JP/tiddlers/commands/ServerCommand.tid +16 -0
- package/editions/ja-JP/tiddlers/commands/SetFieldCommand.tid +9 -0
- package/editions/ja-JP/tiddlers/commands/UnpackPluginCommand.tid +10 -0
- package/editions/ja-JP/tiddlers/commands/VerboseCommand.tid +6 -0
- package/editions/ja-JP/tiddlers/commands/VersionCommand.tid +6 -0
- package/editions/ja-JP/tiddlers/community/Articles.tid +3 -3
- package/editions/ja-JP/tiddlers/community/Community Editions.tid +2 -2
- package/editions/ja-JP/tiddlers/community/Community Links Aggregator.tid +13 -0
- package/editions/ja-JP/tiddlers/community/Community Palettes.tid +2 -2
- package/editions/ja-JP/tiddlers/community/Community Plugins.tid +2 -2
- package/editions/ja-JP/tiddlers/community/Community Themes.tid +2 -2
- package/editions/ja-JP/tiddlers/community/Community.tid +4 -6
- package/editions/ja-JP/tiddlers/community/Examples.tid +3 -3
- package/editions/ja-JP/tiddlers/community/Forums.tid +9 -18
- package/editions/ja-JP/tiddlers/community/Improving TiddlyWiki Documentation.tid +55 -0
- package/editions/ja-JP/tiddlers/community/Latest.tid +2 -2
- package/editions/ja-JP/tiddlers/community/Meetups.tid +2 -2
- package/editions/ja-JP/tiddlers/community/Other Resources.tid +2 -2
- package/editions/ja-JP/tiddlers/community/Resources.tid +13 -0
- package/editions/ja-JP/tiddlers/community/TiddlyWiki European Meetup 2016.tid +17 -0
- package/editions/ja-JP/tiddlers/community/TiddlyWiki European Meetup 2017.tid +13 -0
- package/editions/ja-JP/tiddlers/community/TiddlyWiki Hangouts.tid +1 -1
- package/editions/ja-JP/tiddlers/community/TiddlyWiki Newsletter.tid +12 -0
- package/editions/ja-JP/tiddlers/community/TiddlyWiki on the Web.tid +3 -3
- package/editions/ja-JP/tiddlers/community/Translate TiddlyWiki into your language.tid +18 -0
- package/editions/ja-JP/tiddlers/community/Tutorials.tid +2 -2
- package/editions/ja-JP/tiddlers/community/articles/_A free, open source wiki revisited_ by Mark Gibbs, NetworkWorld.tid +21 -0
- package/editions/ja-JP/tiddlers/community/articles/_Notizen mit TiddlyWiki systemubergreifend nutzen_ by Michael Sonntag.tid +19 -0
- package/editions/ja-JP/tiddlers/community/articles/_Setting Up a Personal TiddlyWiki Server on OS X_ by Kris Johnson.tid +24 -0
- package/editions/ja-JP/tiddlers/community/articles/_TiddlyWiki 5 im Betatest_ by besim.tid +17 -0
- package/editions/ja-JP/tiddlers/community/articles/_TiddlyWiki_ by Sander de Boer.tid +17 -0
- package/editions/ja-JP/tiddlers/community/docs/Community Cards Caveats.tid +7 -0
- package/editions/ja-JP/tiddlers/community/docs/Community Cards.tid +13 -0
- package/editions/ja-JP/tiddlers/community/docs/Displaying Community Cards.tid +28 -0
- package/editions/ja-JP/tiddlers/community/docs/Submitting a Community Card.tid +38 -0
- package/editions/ja-JP/tiddlers/community/editions/Drift by Tony K.tid +20 -0
- package/editions/ja-JP/tiddlers/community/editions/Stroll by David Gifford.tid +20 -0
- package/editions/ja-JP/tiddlers/community/editions/Tidme by oflg.tid +18 -0
- package/editions/ja-JP/tiddlers/community/editions/_Cardo-A Task and Project Management Wiki_ by David_Szego.tid +23 -0
- package/editions/ja-JP/tiddlers/community/examples/GitFixUm.tid +0 -1
- package/editions/ja-JP/tiddlers/community/examples/PETTIL.tid +1 -1
- package/editions/ja-JP/tiddlers/community/examples/_Lucky Sushi_ online shop by sini-Kit.tid +2 -1
- package/editions/ja-JP/tiddlers/community/plugins/GSD5.tid +16 -0
- package/editions/ja-JP/tiddlers/community/plugins/TW5-Graph by Flibbles.tid +22 -0
- package/editions/ja-JP/tiddlers/community/plugins/TiddlyWiki for Scholars.tid +16 -0
- package/editions/ja-JP/tiddlers/community/project/TiddlyWiki People.tid +13 -0
- package/editions/ja-JP/tiddlers/community/project/TiddlyWiki Project.tid +13 -0
- package/editions/ja-JP/tiddlers/community/project/Vacant Positions.tid +5 -0
- package/editions/ja-JP/tiddlers/community/resources/Projectify by Nicolas Petton.tid +24 -0
- package/editions/ja-JP/tiddlers/community/resources/TiddlyWiki Posts.tid +16 -0
- package/editions/ja-JP/tiddlers/community/resources/Wikilabs by PMario.tid +18 -0
- package/editions/ja-JP/tiddlers/community/resources/_savetiddlers_ Extension for Firefox by buggyj.tid +18 -0
- package/editions/ja-JP/tiddlers/community/tools/cards/Procedures.tid +168 -0
- package/editions/ja-JP/tiddlers/concepts/ExternalImages.tid +29 -11
- package/editions/ja-JP/tiddlers/concepts/Filters.tid +2 -1
- package/editions/ja-JP/tiddlers/concepts/TemplateTiddlers.tid +20 -0
- package/editions/ja-JP/tiddlers/concepts/TextReference.tid +36 -0
- package/editions/ja-JP/tiddlers/concepts/Transclusion.tid +31 -0
- package/editions/ja-JP/tiddlers/concepts/WikiText.tid +17 -0
- package/editions/ja-JP/tiddlers/definitions/Base64.tid +9 -0
- package/editions/ja-JP/tiddlers/definitions/Cascading Style Sheets.tid +9 -0
- package/editions/ja-JP/tiddlers/definitions/Definitions.tid +12 -0
- package/editions/ja-JP/tiddlers/definitions/Tiddlyhost.tid +13 -0
- package/editions/ja-JP/tiddlers/features/Future Proof.tid +3 -3
- package/editions/ja-JP/tiddlers/filters/syntax/Filter Run Prefix.tid +0 -1
- package/editions/ja-JP/tiddlers/filters/syntax/Filter Step.tid +5 -5
- package/editions/ja-JP/tiddlers/functions/Functions.tid +30 -0
- package/editions/ja-JP/tiddlers/gettingstarted/GettingStarted - Internet Explorer.tid +1 -1
- package/editions/ja-JP/tiddlers/hellothere/Find Out More.tid +2 -2
- package/editions/ja-JP/tiddlers/hellothere/HelloThere.tid +28 -6
- package/editions/ja-JP/tiddlers/hellothere/HelloThumbnail.tid +7 -0
- package/editions/ja-JP/tiddlers/hellothere/Testimonials and Reviews.tid +2 -2
- package/editions/ja-JP/tiddlers/hellothere/quickstart/Quick Start.tid +2 -2
- package/editions/ja-JP/tiddlers/hellothere/thumbnails/HelloThumbnail - Community Survey.tid +10 -0
- package/editions/ja-JP/tiddlers/hellothere/thumbnails/HelloThumbnail - Donations.tid +9 -0
- package/editions/ja-JP/tiddlers/hellothere/thumbnails/HelloThumbnail - Grok TiddlyWiki.tid +0 -1
- package/editions/ja-JP/tiddlers/hellothere/thumbnails/HelloThumbnail - Intertwingled Innovations.tid +1 -1
- package/editions/ja-JP/tiddlers/hellothere/thumbnails/HelloThumbnail - MultiWikiServer.tid +2 -2
- package/editions/ja-JP/tiddlers/hellothere/thumbnails/HelloThumbnail - Newsletter.tid +3 -2
- package/editions/ja-JP/tiddlers/hellothere/thumbnails/HelloThumbnail - TW5-Graph.tid +12 -0
- package/editions/ja-JP/tiddlers/hellothere/thumbnails/HelloThumbnail - TiddlyWiki Privacy.tid +2 -2
- package/editions/ja-JP/tiddlers/hellothere/thumbnails/HelloThumbnail - TiddlyWikiLinks.tid +1 -1
- package/editions/ja-JP/tiddlers/hellothere/thumbnails/HelloThumbnail - Twenty Years of TiddlyWiki.tid +0 -1
- package/editions/ja-JP/tiddlers/hiddensettings/Hidden Setting Default Tiddler Colour.tid +3 -3
- package/editions/ja-JP/tiddlers/hire-jeremy/Hire Jeremy Sidebar Segment.tid +16 -0
- package/editions/ja-JP/tiddlers/hire-jeremy/HireJeremy.tid +59 -0
- package/editions/ja-JP/tiddlers/howtos/Concatenating text and variables using macro substitution.tid +1 -1
- package/editions/ja-JP/tiddlers/howtos/Hard_Linebreaks_with_CSS.tid +28 -0
- package/editions/ja-JP/tiddlers/howtos/Hard_Linebreaks_with_CSS_-_Example.tid +16 -0
- package/editions/ja-JP/tiddlers/howtos/Windows HTA Hack.tid +2 -1
- package/editions/ja-JP/tiddlers/marketplace/TiddlyWiki Marketplace.tid +20 -0
- package/editions/ja-JP/tiddlers/plugins/Dynaview Plugin.tid +1 -1
- package/editions/ja-JP/tiddlers/plugins/Innerwiki Plugin.tid +1 -1
- package/editions/ja-JP/tiddlers/plugins/Share Plugin.tid +6 -4
- package/editions/ja-JP/tiddlers/procedures/Procedure Calls.tid +58 -0
- package/editions/ja-JP/tiddlers/procedures/Procedure Definitions.tid +47 -0
- package/editions/ja-JP/tiddlers/procedures/Procedure Parameter Handling.tid +26 -0
- package/editions/ja-JP/tiddlers/reference/Reference.tid +17 -0
- package/editions/ja-JP/tiddlers/roadmap/RoadMap.tid +9 -4
- package/editions/ja-JP/tiddlers/saving/Encryption.tid +3 -3
- package/editions/ja-JP/tiddlers/saving/Saving via WebDAV.tid +9 -1
- package/editions/ja-JP/tiddlers/saving/Saving with TiddlyIE.tid +2 -1
- package/editions/ja-JP/tiddlers/saving/Saving.tid +2 -2
- package/editions/ja-JP/tiddlers/system/TableOfContents.tid +1 -1
- package/editions/ja-JP/tiddlers/system/download-empty.tid +1 -1
- package/editions/ja-JP/tiddlers/variables/Behaviour of variables invoked via widget attributes.tid +13 -0
- package/editions/ja-JP/tiddlers/wikitext/Anchor Links using HTML.tid +202 -0
- package/editions/ja-JP/tiddlers/wikitext/Block Quotes in WikiText.tid +106 -0
- package/editions/ja-JP/tiddlers/wikitext/Code Blocks in WikiText.tid +43 -0
- package/editions/ja-JP/tiddlers/wikitext/Conditional Shortcut Syntax.tid +64 -0
- package/editions/ja-JP/tiddlers/wikitext/Dashes in WikiText.tid +14 -0
- package/editions/ja-JP/tiddlers/wikitext/Description Lists in WikiText.tid +16 -0
- package/editions/ja-JP/tiddlers/wikitext/Filtered Attribute Values.tid +18 -0
- package/editions/ja-JP/tiddlers/wikitext/Formatting in WikiText.tid +62 -0
- package/editions/ja-JP/tiddlers/wikitext/HTML Entities.tid +68 -0
- package/editions/ja-JP/tiddlers/wikitext/HTML in WikiText.tid +94 -0
- package/editions/ja-JP/tiddlers/wikitext/HTML_Links_in_WikiText.tid +19 -0
- package/editions/ja-JP/tiddlers/wikitext/Hard Linebreaks in WikiText.tid +24 -0
- package/editions/ja-JP/tiddlers/wikitext/Headings in WikiText.tid +22 -0
- package/editions/ja-JP/tiddlers/wikitext/Horizontal Rules in WikiText.tid +12 -0
- package/editions/ja-JP/tiddlers/wikitext/Linking in WikiText.tid +127 -0
- package/editions/ja-JP/tiddlers/wikitext/Lists in WikiText.tid +94 -0
- package/editions/ja-JP/tiddlers/wikitext/Literal Attribute Values.tid +32 -0
- package/editions/ja-JP/tiddlers/wikitext/Macro Calls.tid +60 -0
- package/editions/ja-JP/tiddlers/wikitext/Macro Definitions.tid +69 -0
- package/editions/ja-JP/tiddlers/wikitext/Macro Parameter Handling.tid +80 -0
- package/editions/ja-JP/tiddlers/wikitext/Paragraphs in WikiText.tid +25 -0
- package/editions/ja-JP/tiddlers/wikitext/Substituted Attribute Values.tid +35 -0
- package/editions/ja-JP/tiddlers/wikitext/Table Classes Captions Headers and Footers.tid +22 -0
- package/editions/ja-JP/tiddlers/wikitext/Tables in WikiText CSS Utility Classes.tid +83 -0
- package/editions/ja-JP/tiddlers/wikitext/Tables in WikiText.tid +74 -0
- package/editions/ja-JP/tiddlers/wikitext/Transcluded Attribute Values.tid +16 -0
- package/editions/ja-JP/tiddlers/wikitext/Transclusion Basic Usage.tid +47 -0
- package/editions/ja-JP/tiddlers/wikitext/Transclusion and Substitution.tid +62 -0
- package/editions/ja-JP/tiddlers/wikitext/Transclusion in WikiText.tid +78 -0
- package/editions/ja-JP/tiddlers/wikitext/Transclusion with Templates.tid +62 -0
- package/editions/ja-JP/tiddlers/wikitext/Typed Blocks in WikiText.tid +69 -0
- package/editions/ja-JP/tiddlers/wikitext/Utility Classes.tid +23 -0
- package/editions/ja-JP/tiddlers/wikitext/Variable Attribute Values.tid +19 -0
- package/editions/ja-JP/tiddlers/wikitext/Widget Attributes.tid +28 -0
- package/editions/ja-JP/tiddlers/wikitext/Widgets in WikiText.tid +33 -0
- package/editions/ja-JP/tiddlers/wikitext/parser/WikiText Parser Modes.tid +20 -0
- package/editions/ja-JP/tiddlers/wikitext/parser/WikiText parser mode_ transclusion examples.tid +58 -0
- package/editions/ja-JP/tiddlers/wikitext/parser/table-example.tid +10 -0
- package/editions/ja-JP/tiddlers/workingwithtw/Sharing your tiddlers with others.tid +3 -3
- package/editions/ja-JP/tiddlywiki.info +1 -2
- package/editions/ko-KR/tiddlers/system/download-empty.tid +1 -1
- package/editions/ko-KR/tiddlywiki.info +1 -2
- package/editions/prerelease/tiddlers/system/DefaultTiddlers.tid +1 -1
- package/editions/prerelease/tiddlers/system/PrereleaseLocalPluginLibrary.tid +1 -1
- package/editions/prerelease/tiddlers/system/PrereleaseOfficialPluginLibrary.tid +1 -1
- package/editions/prerelease/tiddlers/system/TiddlyWiki Pre-release.tid +1 -0
- package/editions/prerelease/tiddlers/system/download-empty.tid +1 -1
- package/editions/prerelease/tiddlywiki.info +2 -1
- package/editions/test/playwright.spec.js +17 -17
- package/editions/test/tiddlers/$__StoryList.tid +2 -0
- package/editions/test/tiddlers/tests/data/functions/FunctionDefaultValues.tid +16 -0
- package/editions/test/tiddlers/tests/data/functions/FunctionSubstituteResolution.tid +38 -0
- package/editions/test/tiddlers/tests/data/functions/VariableLeakage.tid +15 -0
- package/editions/test/tiddlers/tests/data/functions/VariablesEnumeration.tid +14 -0
- package/editions/test/tiddlers/tests/data/genesis-widget/Block.tid +1 -1
- package/editions/test/tiddlers/tests/data/let-filter-prefix/ResultList.tid +12 -0
- package/editions/test/tiddlers/tests/data/let-filter-prefix/ResultListUnnamedVariable.tid +12 -0
- package/editions/test/tiddlers/tests/data/let-filter-prefix/ShortcutSyntax.tid +12 -0
- package/editions/test/tiddlers/tests/data/let-filter-prefix/Simple.tid +12 -0
- package/editions/test/tiddlers/tests/data/macros/dynamic-macros/Attribute.tid +26 -0
- package/editions/test/tiddlers/tests/data/macros/dynamic-macros/Standalone.tid +23 -0
- package/editions/test/tiddlers/tests/data/multi-valued-variables/AttributeFirstValue.tid +16 -0
- package/editions/test/tiddlers/tests/data/multi-valued-variables/DefaultParameterMVV.tid +19 -0
- package/editions/test/tiddlers/tests/data/multi-valued-variables/Function.tid +18 -0
- package/editions/test/tiddlers/tests/data/multi-valued-variables/InlineDisplay.tid +16 -0
- package/editions/test/tiddlers/tests/data/multi-valued-variables/InlineDisplaySeparator.tid +16 -0
- package/editions/test/tiddlers/tests/data/multi-valued-variables/InlineFilterDisplay.tid +14 -0
- package/editions/test/tiddlers/tests/data/multi-valued-variables/InlineFilterDisplaySeparator.tid +14 -0
- package/editions/test/tiddlers/tests/data/multi-valued-variables/MissingVariable.tid +12 -0
- package/editions/test/tiddlers/tests/data/multi-valued-variables/NegatedTitle.tid +18 -0
- package/editions/test/tiddlers/tests/data/multi-valued-variables/Operands.tid +18 -0
- package/editions/test/tiddlers/tests/data/multi-valued-variables/Parameters.tid +21 -0
- package/editions/test/tiddlers/tests/data/multi-valued-variables/ParametersShortcut.tid +21 -0
- package/editions/test/tiddlers/tests/data/multi-valued-variables/Simple.tid +17 -0
- package/editions/test/tiddlers/tests/data/multi-valued-variables/TranscludeParameter.tid +19 -0
- package/editions/test/tiddlers/tests/data/multi-valued-variables/TranscludeParameterDirectly.tid +19 -0
- package/editions/test/tiddlers/tests/data/multi-valued-variables/TranscludeParameterFunction.tid +17 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/macrocall-colon-named.tid +13 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/macrocall-colon-non-strict.tid +13 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/macrocall-equals-no-value.tid +13 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/macrocall-named-equals.tid +13 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/macrocall-named-filtered-value.tid +13 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/macrocall-named-indirect-value.tid +17 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/macrocall-named-mvv-value.tid +14 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/macrocall-named-nested-macro.tid +14 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/macrocall-named-substituted-value.tid +13 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/macrocall-positional-gt.tid +13 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/parse-backcompat-multiline.tid +17 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/parse-backcompat-quoted-gt.tid +14 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/parse-backcompat-single-line.tid +14 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/parse-backcompat.tid +14 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/widget-attr-equals-noval.tid +13 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/widget-attr-malformed-mvv.tid +13 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/widget-attr-mvv-value.tid +14 -0
- package/editions/test/tiddlers/tests/data/parse-backcompat/widget-attr-substituted-value.tid +13 -0
- package/editions/test/tiddlers/tests/data/procedures/Calls.tid +28 -0
- package/editions/test/tiddlers/tests/data/serialize/Attribute.tid +5 -0
- package/editions/test/tiddlers/tests/data/serialize/BlockRule.tid +7 -0
- package/editions/test/tiddlers/tests/data/serialize/BoldEmphasis.tid +5 -0
- package/editions/test/tiddlers/tests/data/serialize/CodeBlock.tid +17 -0
- package/editions/test/tiddlers/tests/data/serialize/CommentBlock.tid +11 -0
- package/editions/test/tiddlers/tests/data/serialize/CommentInline.tid +5 -0
- package/editions/test/tiddlers/tests/data/serialize/Conditional.tid +21 -0
- package/editions/test/tiddlers/tests/data/serialize/Dash.tid +7 -0
- package/editions/test/tiddlers/tests/data/serialize/DynamicMacroMixed.tid +9 -0
- package/editions/test/tiddlers/tests/data/serialize/DynamicMacroParams.tid +9 -0
- package/editions/test/tiddlers/tests/data/serialize/DynamicWidgetAttribute.tid +7 -0
- package/editions/test/tiddlers/tests/data/serialize/Entity.tid +5 -0
- package/editions/test/tiddlers/tests/data/serialize/ExtLink.tid +7 -0
- package/editions/test/tiddlers/tests/data/serialize/FilteredTranscludeBlock.tid +13 -0
- package/editions/test/tiddlers/tests/data/serialize/FilteredTranscludeInline.tid +5 -0
- package/editions/test/tiddlers/tests/data/serialize/FunctionDefinition.tid +15 -0
- package/editions/test/tiddlers/tests/data/serialize/HardLineBreaks.tid +12 -0
- package/editions/test/tiddlers/tests/data/serialize/Heading.tid +29 -0
- package/editions/test/tiddlers/tests/data/serialize/Html.tid +15 -0
- package/editions/test/tiddlers/tests/data/serialize/Image.tid +10 -0
- package/editions/test/tiddlers/tests/data/serialize/Import.tid +6 -0
- package/editions/test/tiddlers/tests/data/serialize/ItalicEmphasis.tid +5 -0
- package/editions/test/tiddlers/tests/data/serialize/List.tid +40 -0
- package/editions/test/tiddlers/tests/data/serialize/MacroCallBlock.tid +13 -0
- package/editions/test/tiddlers/tests/data/serialize/MacroCallInline.tid +7 -0
- package/editions/test/tiddlers/tests/data/serialize/MacroDef.tid +9 -0
- package/editions/test/tiddlers/tests/data/serialize/Parameters.tid +5 -0
- package/editions/test/tiddlers/tests/data/serialize/ParserMode.tid +9 -0
- package/editions/test/tiddlers/tests/data/serialize/PrettyExtLink.tid +6 -0
- package/editions/test/tiddlers/tests/data/serialize/PrettyLink.tid +6 -0
- package/editions/test/tiddlers/tests/data/serialize/QuoteBlock.tid +7 -0
- package/editions/test/tiddlers/tests/data/serialize/RulesPragma.tid +6 -0
- package/editions/test/tiddlers/tests/data/serialize/SimpleText.tid +5 -0
- package/editions/test/tiddlers/tests/data/serialize/SoftLineBreak.tid +6 -0
- package/editions/test/tiddlers/tests/data/serialize/StrikethroughEmphasis.tid +5 -0
- package/editions/test/tiddlers/tests/data/serialize/StyleBlock.tid +17 -0
- package/editions/test/tiddlers/tests/data/serialize/StyleBlock2.tid +13 -0
- package/editions/test/tiddlers/tests/data/serialize/StyleInline.tid +7 -0
- package/editions/test/tiddlers/tests/data/serialize/SubscriptEmphasis.tid +5 -0
- package/editions/test/tiddlers/tests/data/serialize/SuperscriptEmphasis.tid +5 -0
- package/editions/test/tiddlers/tests/data/serialize/SysLink.tid +6 -0
- package/editions/test/tiddlers/tests/data/serialize/Table.tid +11 -0
- package/editions/test/tiddlers/tests/data/serialize/TranscludeBlock.tid +21 -0
- package/editions/test/tiddlers/tests/data/serialize/TranscludeInline.tid +5 -0
- package/editions/test/tiddlers/tests/data/serialize/TypedBlock1.tid +15 -0
- package/editions/test/tiddlers/tests/data/serialize/TypedBlock2.tid +19 -0
- package/editions/test/tiddlers/tests/data/serialize/UnderscoreEmphasis.tid +5 -0
- package/editions/test/tiddlers/tests/data/serialize/VoidElements.tid +12 -0
- package/editions/test/tiddlers/tests/data/serialize/WikiLink.tid +7 -0
- package/editions/test/tiddlers/tests/data/serialize/WikiLinkPrefix.tid +5 -0
- package/editions/test/tiddlers/tests/data/tabs-macro/expected-test-tabs-horizontal-a.tid +1 -1
- package/editions/test/tiddlers/tests/data/tabs-macro/expected-test-tabs-horizontal-all.tid +1 -1
- package/editions/test/tiddlers/tests/data/tabs-macro/expected-test-tabs-vertical.tid +1 -1
- package/editions/test/tiddlers/tests/data/transclude/MissingTiddlerAttribute.tid +34 -0
- package/editions/test/tiddlers/tests/data/transclude/MissingTiddlerAttributeFiltered.tid +20 -0
- package/editions/test/tiddlers/tests/data/transclude/MissingTiddlerAttributeVariable.tid +13 -0
- package/editions/test/tiddlers/tests/data/transclude/Parameterised-ParseTreeNodes.tid +1 -1
- package/editions/test/tiddlers/tests/data/transclude/Procedures-Dollar-Param.tid +22 -0
- package/editions/test/tiddlers/tests/modules/utils/test-csv.js +4 -4
- package/editions/test/tiddlers/tests/test-action-deletefield.js +120 -120
- package/editions/test/tiddlers/tests/test-action-widgets.js +73 -76
- package/editions/test/tiddlers/tests/test-backlinks.js +53 -53
- package/editions/test/tiddlers/tests/test-backtranscludes.js +119 -119
- package/editions/test/tiddlers/tests/test-checkbox-widget.js +491 -493
- package/editions/test/tiddlers/tests/test-compare-filter.js +1 -4
- package/editions/test/tiddlers/tests/test-deserialize-operator.js +18 -21
- package/editions/test/tiddlers/tests/test-deserializers.js +17 -19
- package/editions/test/tiddlers/tests/test-filters.js +123 -123
- package/editions/test/tiddlers/tests/test-html-parser.js +377 -50
- package/editions/test/tiddlers/tests/test-json-filters.js +29 -5
- package/editions/test/tiddlers/tests/test-linked-list.js +4 -4
- package/editions/test/tiddlers/tests/test-parsetextreference.js +1 -1
- package/editions/test/tiddlers/tests/test-prefixes-filter.js +9 -7
- package/editions/test/tiddlers/tests/test-tags-operator.js +45 -45
- package/editions/test/tiddlers/tests/test-tags.js +155 -155
- package/editions/test/tiddlers/tests/test-utils.js +10 -10
- package/editions/test/tiddlers/tests/test-widget-event.js +9 -9
- package/editions/test/tiddlers/tests/test-widget-getVariableInfo.js +7 -18
- package/editions/test/tiddlers/tests/test-widget.js +117 -93
- package/editions/test/tiddlers/tests/test-wikitext-parser.js +89 -80
- package/editions/test/tiddlers/tests/test-wikitext-serialize.js +18 -0
- package/editions/test/tiddlers/tests/test-wikitext-tabs-macro.js +4 -4
- package/editions/test/tiddlers/tests/test-wikitext.js +1 -1
- package/editions/test/tiddlywiki.info +1 -0
- package/editions/testcommonjs/tiddlers/absolute/program.js +5 -5
- package/editions/testcommonjs/tiddlers/absolute/submodule/a.js +1 -1
- package/editions/testcommonjs/tiddlers/allTests.js +11 -11
- package/editions/testcommonjs/tiddlers/cyclic/a.js +2 -2
- package/editions/testcommonjs/tiddlers/cyclic/b.js +2 -2
- package/editions/testcommonjs/tiddlers/cyclic/program.js +8 -8
- package/editions/testcommonjs/tiddlers/determinism/program.js +3 -3
- package/editions/testcommonjs/tiddlers/determinism/submodule/a.js +5 -5
- package/editions/testcommonjs/tiddlers/exactExports/a.js +1 -1
- package/editions/testcommonjs/tiddlers/exactExports/program.js +4 -4
- package/editions/testcommonjs/tiddlers/hasOwnProperty/program.js +4 -4
- package/editions/testcommonjs/tiddlers/method/a.js +4 -4
- package/editions/testcommonjs/tiddlers/method/program.js +6 -6
- package/editions/testcommonjs/tiddlers/missing/program.js +5 -5
- package/editions/testcommonjs/tiddlers/monkeys/a.js +1 -1
- package/editions/testcommonjs/tiddlers/monkeys/program.js +4 -4
- package/editions/testcommonjs/tiddlers/nested/a/b/c/d.js +1 -1
- package/editions/testcommonjs/tiddlers/nested/program.js +3 -3
- package/editions/testcommonjs/tiddlers/relative/program.js +5 -5
- package/editions/testcommonjs/tiddlers/relative/submodule/a.js +1 -1
- package/editions/testcommonjs/tiddlers/test.js +9 -9
- package/editions/testcommonjs/tiddlers/transitive/a.js +1 -1
- package/editions/testcommonjs/tiddlers/transitive/b.js +1 -1
- package/editions/testcommonjs/tiddlers/transitive/c.js +1 -1
- package/editions/testcommonjs/tiddlers/transitive/program.js +3 -3
- package/editions/tiddlywiki-surveys/scripts/extract-text-tiddlers-via-console.js +4 -4
- package/editions/tiddlywiki-surveys/tiddlers/2025-community-survey/Community Survey 2025 Answer 00189.json +37 -0
- package/editions/tiddlywiki-surveys/tiddlers/2025-community-survey/Community Survey 2025 Answer 00190.tid +33 -0
- package/editions/tiddlywiki-surveys/tiddlers/2025-community-survey/Community Survey 2025 Answer 00191.json +37 -0
- package/editions/tiddlywiki-surveys/tiddlers/2025-community-survey/Community Survey 2025 Answer 00192.json +37 -0
- package/editions/tiddlywiki-surveys/tiddlers/2025-community-survey/Community Survey 2025 Answer 00193.json +37 -0
- package/editions/tiddlywiki-surveys/tiddlers/2025-community-survey/Community Survey 2025 Answer 00194.tid +33 -0
- package/editions/tiddlywiki-surveys/tiddlers/2025-community-survey/Community Survey 2025 Answer 00195.json +37 -0
- package/editions/tiddlywiki-surveys/tiddlers/2025-community-survey/Community Survey 2025 Answer 00196.json +37 -0
- package/editions/tiddlywiki-surveys/tiddlers/2025-community-survey/Community Survey 2025 Answer 00197.tid +33 -0
- package/editions/tiddlywiki-surveys/tiddlers/2025-community-survey/Community Survey 2025 Answer 00198.json +37 -0
- package/editions/translators/tiddlers/Instructions for Translators.tid +1 -0
- package/editions/translators/tiddlers/system/$__status_UserName.tid +3 -0
- package/editions/translators/tiddlywiki.info +1 -0
- package/editions/tw5.com/tiddlers/Concatenating a text reference to create a URL.tid +13 -0
- package/editions/tw5.com/tiddlers/Concatenating variables to create a URL.tid +13 -0
- package/editions/tw5.com/tiddlers/Core CSS Variables.tid +11 -0
- package/editions/tw5.com/tiddlers/Deprecated Core Classes.tid +13 -0
- package/editions/tw5.com/tiddlers/Deprecated core macros.tid +31 -0
- package/editions/tw5.com/tiddlers/TiddlyWiki Docs PR Maker.tid +3 -4
- package/editions/tw5.com/tiddlers/Writing stylesheets in vanilla CSS.tid +69 -0
- package/editions/tw5.com/tiddlers/_tw_shared/doc-utilities/doc-macros.tid +44 -7
- package/editions/tw5.com/tiddlers/_tw_shared/doc-utilities/doc-styles.tid +15 -2
- package/editions/tw5.com/tiddlers/about/Archive.tid +2 -2
- package/editions/tw5.com/tiddlers/about/Developers.tid +2 -13
- package/editions/tw5.com/tiddlers/about/Donations.tid +16 -0
- package/editions/tw5.com/tiddlers/about/Filter Syntax History.tid +15 -15
- package/editions/tw5.com/tiddlers/about/Funding TiddlyWiki.tid +1 -1
- package/editions/tw5.com/tiddlers/about/History of TiddlyWiki.tid +6 -6
- package/editions/tw5.com/tiddlers/commands/RenderCommand.tid +2 -1
- package/editions/tw5.com/tiddlers/community/Articles.tid +1 -1
- package/editions/tw5.com/tiddlers/community/Community Editions.tid +1 -1
- package/editions/tw5.com/tiddlers/community/Community Palettes.tid +1 -1
- package/editions/tw5.com/tiddlers/community/Community Plugins.tid +1 -1
- package/editions/tw5.com/tiddlers/community/Community Survey 2025.tid +6 -14
- package/editions/tw5.com/tiddlers/community/Community Themes.tid +1 -1
- package/editions/tw5.com/tiddlers/community/Community.tid +3 -5
- package/editions/tw5.com/tiddlers/community/Contributing.tid +2 -2
- package/editions/tw5.com/tiddlers/community/Examples.tid +1 -1
- package/editions/tw5.com/tiddlers/community/Forums.tid +9 -17
- package/editions/tw5.com/tiddlers/community/Improving TiddlyWiki Documentation.tid +2 -2
- package/editions/tw5.com/tiddlers/community/Latest.tid +1 -1
- package/editions/tw5.com/tiddlers/community/Meetups.tid +1 -1
- package/editions/tw5.com/tiddlers/community/Other Resources.tid +1 -1
- package/editions/tw5.com/tiddlers/community/Resources.tid +11 -0
- package/editions/tw5.com/tiddlers/community/Signing the Contributor License Agreement.tid +2 -2
- package/editions/tw5.com/tiddlers/community/TiddlyWiki Newsletter.tid +5 -5
- package/editions/tw5.com/tiddlers/community/Tutorials.tid +1 -1
- package/editions/tw5.com/tiddlers/community/articles/_A free, open source wiki revisited_ by Mark Gibbs, NetworkWorld.tid +2 -1
- package/editions/tw5.com/tiddlers/community/editions/_Cardo-A Task and Project Management Wiki_ by David_Szego.tid +9 -2
- package/editions/tw5.com/tiddlers/community/examples/PETTIL.tid +1 -1
- package/editions/tw5.com/tiddlers/community/examples/Reveal.js by Devin Weaver.tid +1 -1
- package/editions/tw5.com/tiddlers/community/examples/_Lucky Sushi_ online shop by sini-Kit.tid +2 -1
- package/editions/tw5.com/tiddlers/community/plugins/IndexedDB Plugin by Andreas Abeck.tid +2 -1
- package/editions/tw5.com/tiddlers/community/plugins/Slider by Mohammad.tid +2 -2
- package/editions/tw5.com/tiddlers/community/plugins/TW5-Graph by Flibbles.tid +20 -0
- package/editions/tw5.com/tiddlers/community/resources/_savetiddlers_ Extension for Firefox by buggyj.tid +16 -0
- package/editions/tw5.com/tiddlers/community/tutorials/Un wiki sur votre BiblioBox avec TiddlyWiki.tid +2 -1
- package/editions/tw5.com/tiddlers/communitycards/tiddlywiki.files +11 -0
- package/editions/tw5.com/tiddlers/concepts/CompoundTiddlers.tid +2 -2
- package/editions/tw5.com/tiddlers/concepts/Date Fields.tid +3 -2
- package/editions/tw5.com/tiddlers/concepts/DefaultTiddlers.tid +1 -1
- package/editions/tw5.com/tiddlers/concepts/Filters.tid +1 -1
- package/editions/tw5.com/tiddlers/concepts/TiddlyWiki.tid +1 -1
- package/editions/tw5.com/tiddlers/css-variables/--tp-animation-duration CSS Variable.tid +8 -0
- package/editions/tw5.com/tiddlers/css-variables/--tp-body-font-size Variable.tid +8 -0
- package/editions/tw5.com/tiddlers/css-variables/--tp-body-line-height Variable.tid +8 -0
- package/editions/tw5.com/tiddlers/css-variables/--tp-code-font-family Variable.tid +8 -0
- package/editions/tw5.com/tiddlers/css-variables/--tp-code-wrapping Variable.tid +8 -0
- package/editions/tw5.com/tiddlers/css-variables/--tp-editor-font-family Variable.tid +8 -0
- package/editions/tw5.com/tiddlers/css-variables/--tp-font-family Variable.tid +8 -0
- package/editions/tw5.com/tiddlers/css-variables/--tp-font-size Variable.tid +8 -0
- package/editions/tw5.com/tiddlers/css-variables/--tp-line-height Variable.tid +8 -0
- package/editions/tw5.com/tiddlers/css-variables/--tp-sidebar-breakpoint CSS Variable.tid +8 -0
- package/editions/tw5.com/tiddlers/css-variables/--tp-sidebar-width CSS Variable.tid +8 -0
- package/editions/tw5.com/tiddlers/css-variables/--tp-story-left CSS Variable.tid +8 -0
- package/editions/tw5.com/tiddlers/css-variables/--tp-story-right CSS Variable.tid +8 -0
- package/editions/tw5.com/tiddlers/css-variables/--tp-story-top CSS Variable.tid +8 -0
- package/editions/tw5.com/tiddlers/css-variables/--tp-story-width CSS Variable.tid +8 -0
- package/editions/tw5.com/tiddlers/css-variables/--tp-tiddler-width CSS Variable.tid +8 -0
- package/editions/tw5.com/tiddlers/css-variables/--tpc-_ variables.tid +16 -0
- package/editions/tw5.com/tiddlers/definitions/BT.tid +1 -1
- package/editions/tw5.com/tiddlers/definitions/ContentType.tid +9 -8
- package/editions/tw5.com/tiddlers/definitions/Intertwingled Innovations.tid +1 -1
- package/editions/tw5.com/tiddlers/definitions/JeremyRuston.tid +1 -13
- package/editions/tw5.com/tiddlers/definitions/Jermolene.tid +1 -1
- package/editions/tw5.com/tiddlers/definitions/Osmosoft.tid +1 -1
- package/editions/tw5.com/tiddlers/demonstrations/SampleTiddlerFirst.tid +5 -2
- package/editions/tw5.com/tiddlers/demonstrations/SampleTiddlerSecond.tid +4 -2
- package/editions/tw5.com/tiddlers/demonstrations/TableOfContentsMacro Simple Example.tid +36 -4
- package/editions/tw5.com/tiddlers/demonstrations/Tasks/TaskManagementExample.tid +9 -9
- package/editions/tw5.com/tiddlers/demonstrations/Tasks/TaskManagementExampleDraggable.tid +7 -3
- package/editions/tw5.com/tiddlers/features/DateFormat.tid +18 -17
- package/editions/tw5.com/tiddlers/filters/examples/days.tid +5 -7
- package/editions/tw5.com/tiddlers/filters/examples/jsondelete.tid +59 -0
- package/editions/tw5.com/tiddlers/filters/examples/substitute Operator (Examples).tid +45 -22
- package/editions/tw5.com/tiddlers/filters/function.tid +2 -2
- package/editions/tw5.com/tiddlers/filters/jsondelete.tid +54 -0
- package/editions/tw5.com/tiddlers/filters/range.tid +36 -22
- package/editions/tw5.com/tiddlers/filters/substitute Operator.tid +2 -2
- package/editions/tw5.com/tiddlers/filters/syntax/Filter Expression.tid +2 -0
- package/editions/tw5.com/tiddlers/filters/syntax/Filter Parameter.tid +11 -1
- package/editions/tw5.com/tiddlers/filters/syntax/Filter Step.tid +4 -4
- package/editions/tw5.com/tiddlers/filters/syntax/Filter Syntax.tid +1 -1
- package/editions/tw5.com/tiddlers/filters/syntax/Interchangeable Filter Run Prefixes.tid +3 -0
- package/editions/tw5.com/tiddlers/filters/syntax/Intersection Filter Run Prefix.tid +10 -1
- package/editions/tw5.com/tiddlers/filters/syntax/Let Filter Run Prefix (Examples).tid +13 -0
- package/editions/tw5.com/tiddlers/filters/syntax/Let Filter Run Prefix.tid +30 -0
- package/editions/tw5.com/tiddlers/filters/syntax/Named Filter Run Prefix.tid +11 -0
- package/editions/tw5.com/tiddlers/filters/syntax/Shortcut Filter Run Prefixes.tid +4 -3
- package/editions/tw5.com/tiddlers/filters/syntax/then Filter Run Prefix.tid +1 -1
- package/editions/tw5.com/tiddlers/filters/title.tid +2 -0
- package/editions/tw5.com/tiddlers/functions/Functions.tid +6 -5
- package/editions/tw5.com/tiddlers/hellothere/HelloThere.tid +1 -1
- package/editions/tw5.com/tiddlers/hellothere/HelloThumbnail.tid +1 -1
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Community Survey.tid +3 -3
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Donations.tid +9 -0
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Intertwingled Innovations.tid +1 -1
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Latest Version.tid +1 -0
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - MultiWikiServer.tid +2 -1
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Newsletter.tid +3 -2
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - TW5-Graph.tid +11 -0
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - TiddlyWiki Privacy.tid +2 -1
- package/editions/tw5.com/tiddlers/hire-jeremy/Hire Jeremy Sidebar Segment.tid +15 -0
- package/editions/tw5.com/tiddlers/hire-jeremy/HireJeremy.tid +56 -0
- package/editions/tw5.com/tiddlers/hire-jeremy/HireJeremyDefinitions.tid +24 -0
- package/editions/tw5.com/tiddlers/hire-jeremy/HireJeremyStyles.tid +163 -0
- package/editions/tw5.com/tiddlers/howtos/Concatenating text and variables using macro substitution.tid +1 -1
- package/editions/tw5.com/tiddlers/howtos/How to create dynamic editor toolbar buttons.tid +4 -1
- package/editions/tw5.com/tiddlers/howtos/How to create keyboard shortcuts.tid +49 -38
- package/editions/tw5.com/tiddlers/images/Blurry Lawn.jpg +0 -0
- package/editions/tw5.com/tiddlers/images/Community Survey 2025 Image.webp +0 -0
- package/editions/tw5.com/tiddlers/images/Community Survey 2025 Image.webp.meta +4 -0
- package/editions/tw5.com/tiddlers/images/Intertwingled Innovations Image.webp +0 -0
- package/editions/tw5.com/tiddlers/images/Intertwingled Innovations Image.webp.meta +3 -0
- package/editions/tw5.com/tiddlers/images/MWS Banner.webp +0 -0
- package/editions/tw5.com/tiddlers/images/MWS Banner.webp.meta +6 -0
- package/editions/tw5.com/tiddlers/images/Marketplace Banner.webp +0 -0
- package/editions/tw5.com/tiddlers/images/Marketplace Banner.webp.meta +4 -0
- package/editions/tw5.com/tiddlers/images/New Release Banner.webp +0 -0
- package/editions/tw5.com/tiddlers/images/New Release Banner.webp.meta +4 -0
- package/editions/tw5.com/tiddlers/images/TW5-Graph.png +0 -0
- package/editions/tw5.com/tiddlers/images/TW5-Graph.png.meta +4 -0
- package/editions/tw5.com/tiddlers/images/Tiddler Poster.webp +0 -0
- package/editions/tw5.com/tiddlers/images/Tiddler Poster.webp.meta +5 -0
- package/editions/tw5.com/tiddlers/images/TiddlyFox Apocalypse.webp +0 -0
- package/editions/tw5.com/tiddlers/images/TiddlyFox Apocalypse.webp.meta +4 -0
- package/editions/tw5.com/tiddlers/images/TiddlyWiki Classic.webp +0 -0
- package/editions/tw5.com/tiddlers/images/TiddlyWiki Classic.webp.meta +4 -0
- package/editions/tw5.com/tiddlers/images/TiddlyWiki Donation Graphic.webp +0 -0
- package/editions/tw5.com/tiddlers/images/TiddlyWiki Donation Graphic.webp.meta +4 -0
- package/editions/tw5.com/tiddlers/images/TiddlyWiki Newsletter Badge.webp +0 -0
- package/editions/tw5.com/tiddlers/images/TiddlyWiki Newsletter Badge.webp.meta +4 -0
- package/editions/tw5.com/tiddlers/images/TiddlyWiki Privacy Badge.webp +0 -0
- package/editions/tw5.com/tiddlers/images/TiddlyWiki Privacy Badge.webp.meta +4 -0
- package/editions/tw5.com/tiddlers/images/Twenty Years of TiddlyWiki.webp +0 -0
- package/editions/tw5.com/tiddlers/images/Twenty Years of TiddlyWiki.webp.meta +4 -0
- package/editions/tw5.com/tiddlers/macros/StylesheetMacros.tid +2 -17
- package/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid +4 -1
- package/editions/tw5.com/tiddlers/macros/examples/tabs.tid +12 -0
- package/editions/tw5.com/tiddlers/macros/list-links-draggable Macro.tid +26 -8
- package/editions/tw5.com/tiddlers/macros/list-tagged-draggable Macro.tid +20 -6
- package/editions/tw5.com/tiddlers/macros/syntax/Call Syntax.tid +43 -0
- package/editions/tw5.com/tiddlers/macros/syntax/CallParameterValue.tid +13 -0
- package/editions/tw5.com/tiddlers/macros/syntax/Macro Call Syntax.tid +3 -27
- package/editions/tw5.com/tiddlers/macros/syntax/Macro Definition Syntax.tid +1 -1
- package/editions/tw5.com/tiddlers/macros/syntax/Procedure Call Syntax.tid +2 -29
- package/editions/tw5.com/tiddlers/macros/syntax/Procedure Definition Syntax.tid +2 -2
- package/editions/tw5.com/tiddlers/macros/syntax/Procedure Syntax.tid +1 -1
- package/editions/tw5.com/tiddlers/macros/tag-pill_Macro.tid +13 -8
- package/editions/tw5.com/tiddlers/mechanisms/Background Actions.tid +28 -0
- package/editions/tw5.com/tiddlers/mechanisms/InfoMechanism.tid +30 -3
- package/editions/tw5.com/tiddlers/mechanisms/MediaQueryTrackerMechanism.tid +13 -0
- package/editions/tw5.com/tiddlers/nodejs/Installing official plugins on Node.js.tid +1 -0
- package/editions/tw5.com/tiddlers/plugins/Plugin_Fields.tid +2 -1
- package/editions/tw5.com/tiddlers/pragmas/Pragma_ _function.tid +1 -1
- package/editions/tw5.com/tiddlers/pragmas/Pragma_ _procedure.tid +1 -1
- package/editions/tw5.com/tiddlers/procedures/Procedure Calls.tid +2 -51
- package/editions/tw5.com/tiddlers/procedures/Procedures.tid +2 -2
- package/editions/tw5.com/tiddlers/procedures/calls/Calls.tid +64 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.3.8/#9133.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.3.8/#9166.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.3.8/#9175.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.3.8/#9184.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.3.8/#9185.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.3.8/32caeb69c3e7b75a80a84a1e14363e87175b164e.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.3.8/75502266176de9d4a5e1f89cd7f2e455b7a2f6da.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.3.8/93d30f374da4a6b2037b335f7f7d4eddce8192db.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#7898.tid +11 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#8093.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#8249-aes-256-bit.tid +25 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#8258.tid +14 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#8810.tid +12 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#8972.tid +16 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9015-muted-palette-adjustments.tid +11 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9024 - audio-parser-widget-intercept.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9050.tid +13 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9055.tid +27 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9078.tid +16 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9097.tid +13 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9103.tid +18 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9107 - update-configuration-defaults.tid +11 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9118.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9119 - sticky-flag.tid +7 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9119.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9131 - strikethrough.tid +9 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9131.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9135.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9148.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9154.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9167.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9177.tid +12 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9183 - core-server-pluginisation.tid +9 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9183.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9203.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9206.tid +17 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9207.tid +13 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9214 - configure-edit-focus.tid +13 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9235.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9242 - deprecate-css-macros.tid +7 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9242.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9243.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9253 - textencoder.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9253.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9254-list-links-draggable-parameter-missing.tid +14 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9259.tid +13 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9259_impacts_deprecate-eventcatcher-attributes.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9260.tid +29 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9275 - remove-range-widget-ie.tid +7 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9275.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9277.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9280.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9281-add-th-debug-element.tid +17 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9287.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9293-draft-moduls-not-executed.tid +19 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9295.tid +14 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9297.tid +12 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9305.tid +13 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9313.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9316 - currentcolor.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9316.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9317-eslint-ignore-output.tid +13 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9328.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9333.tid +49 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9337 - math-filters .tid +7 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9337.tid +18 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9341.tid +12 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9347.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9348.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9349 - cjk-text-spacing.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9350 - deprecation.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9350.tid +20 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9358.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9368 - fix-image-paste-rename-ux.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9371.tid +11 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9375.tid +11 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9401.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9422.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9427.tid +11 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9439.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9445.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9453 - diff-text-editcost-param.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9454 - edit-text-rows-precedence.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9465.tid +15 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9466.tid +15 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9489.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9494.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9495.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9538.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9548.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9551.tid +15 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9570.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9582.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9585 - button-classes.tid +13 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9598.tid +11 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9600.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9609.tid +24 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9609_impacts_event detail variables in eventcatcher.json +13 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9612-toc-level.tid +14 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9617 - select-widget-refresh-default.tid +12 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9621 - list-widget-macros-start-endactions.tid +16 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9626.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9634-cascade-info-tab.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9641.tid +14 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9655 - german-translations.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9660.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9676.tid +48 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9703.tid +13 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9782 - Greek translation.tid +13 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/Release 5.4.0.tid +21 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/add-stylesheet-wiki-info.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/bump-markdown-it.tid +18 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/deprecate-util-func - deprecation.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/deprecate-util-func.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/draft-i18n.tid +15 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/escapecss-split.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/improve-alert-a11y.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/leilei332-update-eslint-config.tid +14 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/migrate-to-dmp-es - api.tid +11 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/migrate-to-dmp-es.tid +10 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/refactor-base64-util.tid +14 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release Notes and Changes Internals.tid +65 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release Notes and Changes.tid +59 -0
- package/editions/tw5.com/tiddlers/releasenotes/ReleaseTemplate.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/ReleasesInfo.multids +67 -0
- package/editions/tw5.com/tiddlers/releasenotes/ReleasesProcedures.tid +397 -0
- package/editions/tw5.com/tiddlers/releasenotes/ReleasesStyles.tid +205 -0
- package/editions/tw5.com/tiddlers/releasenotes/ReleasesSummaryLists.tid +3 -0
- package/editions/tw5.com/tiddlers/releasenotes/ReleasesTabTemplate.tid +12 -0
- package/editions/tw5.com/tiddlers/releasenotes/ReleasesViewTemplateBodyChangeNote.tid +6 -0
- package/editions/tw5.com/tiddlers/releasenotes/ReleasesViewTemplateBodyFilters.tid +6 -0
- package/editions/tw5.com/tiddlers/releasenotes/ReleasesViewTemplateBodyImpactNote.tid +6 -0
- package/editions/tw5.com/tiddlers/releasenotes/TiddlyWiki Releases.tid +6 -4
- package/editions/tw5.com/tiddlers/releasenotes/pre-5.4.0/Release 5.1.23.tid +298 -0
- package/editions/tw5.com/tiddlers/releasenotes/pre-5.4.0/Release 5.2.0.tid +302 -0
- package/editions/tw5.com/tiddlers/releasenotes/pre-5.4.0/Release 5.2.4.tid +145 -0
- package/editions/tw5.com/tiddlers/releasenotes/pre-5.4.0/Release 5.2.6.tid +149 -0
- package/editions/tw5.com/tiddlers/releasenotes/pre-5.4.0/Release 5.3.2.tid +184 -0
- package/editions/tw5.com/tiddlers/releasenotes/pre-5.4.0/Release 5.3.7.tid +140 -0
- package/editions/tw5.com/tiddlers/releasenotes/pre-5.4.0/Release 5.3.8.tid +19 -0
- package/editions/tw5.com/tiddlers/roadmap/RoadMap.tid +7 -3
- package/editions/tw5.com/tiddlers/roadmap/multiwikiserver/MultiWikiServer.tid +1 -1
- package/editions/tw5.com/tiddlers/saving/Encrypted Wiki Import Problems.tid +22 -0
- package/editions/tw5.com/tiddlers/saving/Encryption.tid +4 -4
- package/editions/tw5.com/tiddlers/saving/Saving via WebDAV.tid +8 -1
- package/editions/tw5.com/tiddlers/saving/Saving with the HTML5 fallback saver.tid +1 -1
- package/editions/tw5.com/tiddlers/system/ContributionBanner.tid +1 -1
- package/editions/tw5.com/tiddlers/system/DefaultTiddlers.tid +1 -1
- package/editions/tw5.com/tiddlers/system/Sources.tid +1 -1
- package/editions/tw5.com/tiddlers/system/TableOfContents.tid +1 -1
- package/editions/tw5.com/tiddlers/system/download-empty.tid +1 -1
- package/editions/tw5.com/tiddlers/systemtags/SystemTag_ $__tags_ClassFilters_TiddlerTemplate.tid +2 -2
- package/editions/tw5.com/tiddlers/tag-pill Macro (Examples).tid +7 -1
- package/editions/tw5.com/tiddlers/testcases/Calls/ProcedureDynamicAttributes.tid +40 -0
- package/editions/tw5.com/tiddlers/testcases/Calls/ProcedureStaticAttributes.tid +48 -0
- package/editions/tw5.com/tiddlers/testcases/RevealWidget/AccordionSlider.tid +1 -1
- package/editions/tw5.com/tiddlers/testcases/RevealWidget/Popup.tid +1 -1
- package/editions/tw5.com/tiddlers/testcases/RevealWidget/SimpleReveal.tid +1 -1
- package/editions/tw5.com/tiddlers/testcases/RevealWidget/TextReference.tid +1 -1
- package/editions/tw5.com/tiddlers/v5.4.0/Improvements to Macro Calls.tid +48 -0
- package/editions/tw5.com/tiddlers/variables/Behaviour of called variables depends on how the variable was declared.tid +52 -0
- package/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via filter expression function call.tid +1 -1
- package/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via widget attributes.tid +3 -1
- package/editions/tw5.com/tiddlers/variables/Multi-Valued Variables.tid +118 -0
- package/editions/tw5.com/tiddlers/variables/Variables.tid +5 -3
- package/editions/tw5.com/tiddlers/webserver/WebServer API_ Get All Tiddlers.tid +1 -1
- package/editions/tw5.com/tiddlers/webserver/WebServer API_ Get File.tid +14 -3
- package/editions/tw5.com/tiddlers/widgets/ActionLogWidget.tid +45 -18
- package/editions/tw5.com/tiddlers/widgets/ButtonWidget.tid +4 -1
- package/editions/tw5.com/tiddlers/widgets/DiffTextWidget.tid +57 -33
- package/editions/tw5.com/tiddlers/widgets/EditTextWidget.tid +12 -13
- package/editions/tw5.com/tiddlers/widgets/EventCatcherWidget.tid +109 -45
- package/editions/tw5.com/tiddlers/widgets/ImageWidget.tid +18 -1
- package/editions/tw5.com/tiddlers/widgets/LetWidget.tid +14 -2
- package/editions/tw5.com/tiddlers/widgets/LinkWidget.tid +19 -2
- package/editions/tw5.com/tiddlers/widgets/LogWidget.tid +43 -17
- package/editions/tw5.com/tiddlers/widgets/RevealWidget.tid +46 -29
- package/editions/tw5.com/tiddlers/widgets/examples/RevealWidget (Popup Clamping Example).tid +68 -0
- package/editions/tw5.com/tiddlers/wikitext/Definitions in WikiText.tid +3 -10
- package/editions/tw5.com/tiddlers/wikitext/Description Lists in WikiText.tid +44 -0
- package/editions/tw5.com/tiddlers/wikitext/Formatting in WikiText.tid +1 -1
- package/editions/tw5.com/tiddlers/wikitext/Lists in WikiText.tid +5 -1
- package/editions/tw5.com/tiddlers/wikitext/Macro Calls.tid +1 -52
- package/editions/tw5.com/tiddlers/wikitext/Multi-Valued Variable Attribute Values.tid +37 -0
- package/editions/tw5.com/tiddlers/wikitext/Substituted Attribute Values.tid +5 -15
- package/editions/tw5.com/tiddlers/wikitext/Tables in WikiText CSS Utility Classes.tid +11 -0
- package/editions/tw5.com/tiddlers/wikitext/Transclusion in WikiText.tid +22 -0
- package/editions/tw5.com/tiddlers/wikitext/Typed Blocks in WikiText.tid +31 -42
- package/editions/tw5.com/tiddlers/wikitext/Widget Attributes.tid +3 -1
- package/editions/tw5.com/tiddlers/wikitext/Widgets in WikiText.tid +1 -1
- package/editions/tw5.com/tiddlers/wikitext/parser/Block Mode WikiText.tid +2 -2
- package/editions/tw5.com/tiddlers/workingwithtw/TiddlyWiki Privacy and Security.tid +2 -1
- package/editions/tw5.com/tiddlywiki.info +3 -3
- package/editions/zh-Hans/tiddlers/system/download-empty-zh-Hans.tid +1 -1
- package/editions/zh-Hans/tiddlywiki.info +1 -2
- package/editions/zh-Hant/tiddlers/system/download-empty-zh-Hant.tid +1 -1
- package/editions/zh-Hant/tiddlywiki.info +1 -2
- package/eslint.config.mjs +327 -0
- package/languages/ca-ES/ControlPanel.multids +1 -1
- package/languages/da-DK/ControlPanel.multids +1 -1
- package/languages/de-DE/ControlPanel.multids +7 -3
- package/languages/de-DE/Draft.multids +4 -0
- package/languages/de-DE/Import.multids +3 -1
- package/languages/de-DE/Misc.multids +1 -0
- package/languages/de-DE/TiddlerInfo.multids +5 -0
- package/languages/el-GR/ControlPanel.multids +63 -59
- package/languages/el-GR/Docs/PaletteColours.multids +1 -1
- package/languages/el-GR/Draft.multids +4 -0
- package/languages/el-GR/EditTemplate.multids +2 -2
- package/languages/el-GR/Exporters.multids +3 -3
- package/languages/el-GR/Import.multids +3 -1
- package/languages/el-GR/Misc.multids +9 -6
- package/languages/el-GR/SideBar.multids +1 -0
- package/languages/el-GR/SiteSubtitle.tid +1 -1
- package/languages/el-GR/ThemeTweaks.multids +2 -2
- package/languages/el-GR/TiddlerInfo.multids +5 -1
- package/languages/es-ES/ControlPanel.multids +16 -10
- package/languages/es-ES/Fields.multids +3 -3
- package/languages/es-ES/Misc.multids +1 -1
- package/languages/fr-FR/ControlPanel.multids +15 -7
- package/languages/fr-FR/Misc.multids +1 -0
- package/languages/it-IT/ControlPanel.multids +1 -1
- package/languages/ja-JP/Buttons.multids +15 -4
- package/languages/ja-JP/ControlPanel.multids +35 -7
- package/languages/ja-JP/Docs/ModuleTypes.multids +10 -1
- package/languages/ja-JP/Docs/PaletteColours.multids +15 -0
- package/languages/ja-JP/Draft.multids +4 -0
- package/languages/ja-JP/EditTemplate.multids +2 -0
- package/languages/ja-JP/Exporters.multids +4 -1
- package/languages/ja-JP/Fields.multids +14 -8
- package/languages/ja-JP/GettingStarted.tid +7 -14
- package/languages/ja-JP/Help/commands.tid +18 -0
- package/languages/ja-JP/Help/deletetiddlers.tid +8 -0
- package/languages/ja-JP/Help/fetch.tid +38 -0
- package/languages/ja-JP/Help/import.tid +24 -0
- package/languages/ja-JP/Help/listen.tid +34 -0
- package/languages/ja-JP/Help/load.tid +5 -2
- package/languages/ja-JP/Help/password.tid +1 -1
- package/languages/ja-JP/Help/render.tid +36 -0
- package/languages/ja-JP/Help/rendertiddler.tid +19 -3
- package/languages/ja-JP/Help/rendertiddlers.tid +9 -3
- package/languages/ja-JP/Help/save.tid +25 -0
- package/languages/ja-JP/Help/savetiddler.tid +7 -1
- package/languages/ja-JP/Help/savetiddlers.tid +8 -6
- package/languages/ja-JP/Help/savewikifolder.tid +34 -0
- package/languages/ja-JP/Help/server.tid +24 -13
- package/languages/ja-JP/Import.multids +3 -1
- package/languages/ja-JP/Misc.multids +36 -35
- package/languages/ja-JP/NewJournal.multids +1 -1
- package/languages/ja-JP/NewJournalTags.tid +3 -0
- package/languages/ja-JP/Notifications.multids +2 -0
- package/languages/ja-JP/Search.multids +3 -1
- package/languages/ja-JP/SideBar.multids +1 -1
- package/languages/ja-JP/SiteTitle.tid +1 -1
- package/languages/ja-JP/Snippets/FunctionDefinition.tid +7 -0
- package/languages/ja-JP/Snippets/ListByTag.tid +5 -0
- package/languages/ja-JP/Snippets/MacroDefinition.tid +7 -0
- package/languages/ja-JP/Snippets/ProcedureDefinition.tid +7 -0
- package/languages/ja-JP/Snippets/Table4x3.tid +8 -0
- package/languages/ja-JP/Snippets/TableOfContents.tid +9 -0
- package/languages/ja-JP/ThemeTweaks.multids +42 -0
- package/languages/ja-JP/TiddlerInfo.multids +6 -1
- package/languages/ja-JP/Types/application_javascript.tid +5 -0
- package/languages/ja-JP/Types/application_json.tid +5 -0
- package/languages/ja-JP/Types/application_x-tiddler-dictionary.tid +5 -0
- package/languages/ja-JP/Types/image_gif.tid +5 -0
- package/languages/ja-JP/Types/image_jpeg.tid +5 -0
- package/languages/ja-JP/Types/image_png.tid +5 -0
- package/languages/ja-JP/Types/image_svg+xml.tid +5 -0
- package/languages/ja-JP/Types/text_css.tid +5 -0
- package/languages/ja-JP/Types/text_html.tid +5 -0
- package/languages/ja-JP/Types/text_plain.tid +5 -0
- package/languages/ja-JP/Types/text_vnd.tiddlywiki-multiple.tid +5 -0
- package/languages/ja-JP/Types/text_vnd.tiddlywiki.tid +5 -0
- package/languages/mk-MK/ControlPanel.multids +1 -1
- package/languages/nl-NL/ControlPanel.multids +1 -1
- package/languages/pl-PL/ControlPanel.multids +1 -1
- package/languages/pt-BR/ControlPanel.multids +1 -1
- package/languages/pt-PT/ControlPanel.multids +1 -1
- package/languages/sl-SI/ControlPanel.multids +1 -1
- package/languages/zh-Hans/ControlPanel.multids +3 -2
- package/languages/zh-Hans/Draft.multids +4 -0
- package/languages/zh-Hans/Import.multids +2 -0
- package/languages/zh-Hans/Misc.multids +1 -0
- package/languages/zh-Hans/TiddlerInfo.multids +5 -0
- package/languages/zh-Hant/ControlPanel.multids +3 -2
- package/languages/zh-Hant/Draft.multids +4 -0
- package/languages/zh-Hant/Import.multids +2 -0
- package/languages/zh-Hant/Misc.multids +1 -0
- package/languages/zh-Hant/TiddlerInfo.multids +5 -0
- package/licenses/cla-individual.md +22 -0
- package/package.json +9 -6
- package/playwright.config.js +5 -0
- package/plugins/tiddlywiki/aws/modules/command.js +2 -6
- package/plugins/tiddlywiki/aws/modules/init.js +1 -1
- package/plugins/tiddlywiki/bibtex/deserializer.js +1 -1
- package/plugins/tiddlywiki/browser-sniff/browser.js +1 -2
- package/plugins/tiddlywiki/browser-storage/settings.tid +1 -1
- package/plugins/tiddlywiki/browser-storage/startup.js +4 -10
- package/plugins/tiddlywiki/browser-storage/util.js +72 -74
- package/plugins/tiddlywiki/codemirror/engine.js +48 -46
- package/plugins/tiddlywiki/confetti/confetti-widget.js +0 -2
- package/plugins/tiddlywiki/dom-to-image/docs.tid +66 -0
- package/plugins/tiddlywiki/dom-to-image/files/LICENSE +29 -0
- package/plugins/tiddlywiki/dom-to-image/files/dom-to-image-more.min.js +3 -0
- package/plugins/tiddlywiki/dom-to-image/files/tiddlywiki.files +21 -0
- package/plugins/tiddlywiki/dom-to-image/plugin.info +7 -0
- package/plugins/tiddlywiki/dom-to-image/readme.tid +3 -0
- package/plugins/tiddlywiki/dom-to-image/startup.js +92 -0
- package/plugins/tiddlywiki/dynannotate/modules/dynannotate.js +4 -12
- package/plugins/tiddlywiki/dynannotate/modules/element-spotlight.js +1 -1
- package/plugins/tiddlywiki/dynannotate/modules/selection-tracker.js +4 -4
- package/plugins/tiddlywiki/dynannotate/modules/textmap.js +5 -5
- package/plugins/tiddlywiki/dynaview/dynaview.js +1 -1
- package/plugins/tiddlywiki/evernote/modules/enex-deserializer.js +5 -5
- package/plugins/tiddlywiki/external-attachments/startup.js +2 -2
- package/plugins/tiddlywiki/filesystem/filesystemadaptor.js +1 -3
- package/plugins/tiddlywiki/filesystem/plugin.info +1 -0
- package/plugins/tiddlywiki/freelinks/aho-corasick.js +190 -0
- package/plugins/tiddlywiki/freelinks/config-Freelinks-WordBoundary.tid +2 -0
- package/plugins/tiddlywiki/freelinks/readme.tid +26 -5
- package/plugins/tiddlywiki/freelinks/settings.tid +2 -0
- package/plugins/tiddlywiki/freelinks/text.js +229 -113
- package/plugins/tiddlywiki/geospatial/geotools.js +2 -2
- package/plugins/tiddlywiki/geospatial/operators/lookup.js +1 -1
- package/plugins/tiddlywiki/geospatial/operators/olc.js +3 -4
- package/plugins/tiddlywiki/geospatial/operators/transformation.js +2 -3
- package/plugins/tiddlywiki/geospatial/widgets/geomap.js +9 -9
- package/plugins/tiddlywiki/googleanalytics/googleanalytics.js +1 -1
- package/plugins/tiddlywiki/highlight/files/highlight.min.js +1132 -1289
- package/plugins/tiddlywiki/highlight/highlightblock.js +4 -4
- package/plugins/tiddlywiki/highlight/readme.tid +1 -1
- package/plugins/tiddlywiki/innerwiki/innerwiki.js +2 -3
- package/plugins/tiddlywiki/innerwiki/screenshot.js +1 -3
- package/plugins/tiddlywiki/jasmine/jasmine-plugin.js +12 -3
- package/plugins/tiddlywiki/jasmine/run-wiki-based-tests.js +3 -5
- package/plugins/tiddlywiki/jasmine/startup.js +1 -1
- package/plugins/tiddlywiki/jszip/startup.js +3 -3
- package/plugins/tiddlywiki/katex/files/contrib/mhchem.min.js +1 -1
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/plugins/tiddlywiki/katex/files/katex.min.css +1 -1
- package/plugins/tiddlywiki/katex/files/katex.min.js +1 -1
- package/plugins/tiddlywiki/katex/files/katex.without-font-face.min.css +1 -1
- package/plugins/tiddlywiki/katex/files/tiddlywiki.files +2 -2
- package/plugins/tiddlywiki/katex/latex-parser.js +1 -1
- package/plugins/tiddlywiki/katex/readme.tid +1 -1
- package/plugins/tiddlywiki/katex/styles.tid +40 -20
- package/plugins/tiddlywiki/katex/wrapper.js +1 -1
- package/plugins/tiddlywiki/markdown/editor-operations/make-markdown-link.js +1 -1
- package/plugins/tiddlywiki/markdown/files/markdown-it-deflist.min.js +2 -7
- package/plugins/tiddlywiki/markdown/files/markdown-it-footnote.min.js +2 -1
- package/plugins/tiddlywiki/markdown/files/markdown-it-ins.min.js +2 -2
- package/plugins/tiddlywiki/markdown/files/markdown-it-mark.min.js +2 -2
- package/plugins/tiddlywiki/markdown/files/markdown-it-sub.min.js +2 -2
- package/plugins/tiddlywiki/markdown/files/markdown-it-sup.min.js +2 -2
- package/plugins/tiddlywiki/markdown/files/markdown-it.min.js +2 -3
- package/plugins/tiddlywiki/markdown/markdown-it-katex.js +131 -131
- package/plugins/tiddlywiki/markdown/markdown-it-tiddlywiki.js +102 -104
- package/plugins/tiddlywiki/markdown/styles.tid +3 -0
- package/plugins/tiddlywiki/markdown/wrapper.js +32 -23
- package/plugins/tiddlywiki/markdown-legacy/wrapper.js +143 -144
- package/plugins/tiddlywiki/qrcode/makeqr.js +1 -1
- package/plugins/tiddlywiki/railroad/components.js +21 -21
- package/plugins/tiddlywiki/railroad/parser.js +4 -4
- package/plugins/tiddlywiki/railroad/typed-parser.js +5 -5
- package/plugins/tiddlywiki/railroad/wrapper.js +1 -1
- package/plugins/tiddlywiki/stacked-view/stacked.js +0 -1
- package/plugins/tiddlywiki/text-slicer/modules/commands/slice.js +15 -16
- package/plugins/tiddlywiki/text-slicer/modules/slicer.js +69 -70
- package/plugins/tiddlywiki/text-slicer/modules/startup/slicer-startup.js +1 -1
- package/plugins/tiddlywiki/tiddlyweb/config-tiddlers-filter.tid +1 -1
- package/plugins/tiddlywiki/tiddlyweb/save-offline.tid +1 -1
- package/plugins/tiddlywiki/tiddlyweb/tiddlywebadaptor.js +5 -7
- package/plugins/tiddlywiki/translators/output-file-templates/Draft.multids.tid +3 -0
- package/plugins/tiddlywiki/translators/output-file-templates/Misc.multids.tid +1 -0
- package/plugins/tiddlywiki/translators/ui/group/Draft.tid +28 -0
- package/plugins/tiddlywiki/translators/ui/group/Miscellaneous.tid +1 -0
- package/plugins/tiddlywiki/tw2parser/classictransclude.js +3 -4
- package/plugins/tiddlywiki/tw2parser/entry.js +1 -1
- package/plugins/tiddlywiki/tw2parser/parameteradapter.js +6 -5
- package/plugins/tiddlywiki/tw2parser/wikitextrules.js +594 -598
- package/plugins/tiddlywiki/tw5.com-docs/readme.tid +1 -1
- package/plugins/tiddlywiki/twitter/twitter-widget.js +3 -3
- package/plugins/tiddlywiki/twitter-archivist/archivist.js +41 -10
- package/plugins/tiddlywiki/twitter-archivist/loadtwitterarchive.js +5 -7
- package/plugins/tiddlywiki/twitter-archivist/startup.js +4 -4
- package/plugins/tiddlywiki/upgrade/save-tiddler-filter.tid +1 -1
- package/plugins/tiddlywiki/wikitext-serialize/plugin.info +7 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/codeblock.js +13 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/codeinline.js +13 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/commentblock.js +13 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/commentinline.js +13 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/conditional.js +42 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/dash.js +13 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/emphasis/bold.js +13 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/emphasis/italic.js +13 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/emphasis/strikethrough.js +13 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/emphasis/subscript.js +13 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/emphasis/superscript.js +13 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/emphasis/underscore.js +13 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/entity.js +13 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/extlink.js +17 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/filteredtranscludeblock.js +24 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/filteredtranscludeinline.js +15 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/fnprocdef.js +24 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/hardlinebreaks.js +20 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/heading.js +17 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/horizrule.js +13 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/html.js +34 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/image.js +18 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/import.js +15 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/list.js +76 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/macrocallblock.js +27 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/macrocallinline.js +15 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/macrodef.js +21 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/parameters.js +16 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/parsermode.js +14 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/prettyextlink.js +15 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/prettylink.js +15 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/quoteblock.js +24 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/rules.js +26 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/styleblock.js +57 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/styleinline.js +28 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/syslink.js +18 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/table.js +39 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/transcludeblock.js +57 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/transcludeinline.js +15 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/typedblock.js +16 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/wikilink.js +17 -0
- package/plugins/tiddlywiki/wikitext-serialize/rules/wikilinkprefix.js +15 -0
- package/plugins/tiddlywiki/wikitext-serialize/utils/parsetree.js +132 -0
- package/plugins/tiddlywiki/xlsx-utils/deserializer.js +1 -2
- package/plugins/tiddlywiki/xlsx-utils/importer.js +5 -5
- package/plugins/tiddlywiki/xlsx-utils/xlsx-import-command.js +1 -2
- package/readme.md +2 -5
- package/themes/tiddlywiki/snowwhite/base.tid +34 -20
- package/themes/tiddlywiki/vanilla/base.tid +135 -49
- package/themes/tiddlywiki/vanilla/options.multids +1 -1
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -67
- package/.github/workflows/pr-path-validation.yml +0 -18
- package/core/modules/commander.js +0 -172
- package/core/modules/commands/commands.js +0 -36
- package/core/modules/commands/deletetiddlers.js +0 -37
- package/core/modules/commands/fetch.js +0 -170
- package/core/modules/commands/import.js +0 -43
- package/core/modules/commands/init.js +0 -54
- package/core/modules/commands/listen.js +0 -43
- package/core/modules/commands/load.js +0 -46
- package/core/modules/commands/output.js +0 -33
- package/core/modules/commands/render.js +0 -65
- package/core/modules/commands/rendertiddlers.js +0 -64
- package/core/modules/commands/save.js +0 -63
- package/core/modules/commands/savetiddlers.js +0 -51
- package/core/modules/commands/savewikifolder.js +0 -220
- package/core/modules/commands/server.js +0 -50
- package/core/modules/commands/setfield.js +0 -53
- package/core/modules/server/authenticators/basic.js +0 -89
- package/core/modules/server/routes/delete-tiddler.js +0 -22
- package/core/modules/server/routes/get-favicon.js +0 -18
- package/core/modules/server/routes/get-file.js +0 -42
- package/core/modules/server/routes/get-index.js +0 -21
- package/core/modules/server/routes/get-login-basic.js +0 -30
- package/core/modules/server/routes/get-status.js +0 -27
- package/core/modules/server/routes/get-tiddler-html.js +0 -38
- package/core/modules/server/routes/get-tiddler.js +0 -40
- package/core/modules/server/routes/get-tiddlers-json.js +0 -44
- package/core/modules/server/routes/put-tiddler.js +0 -46
- package/core/modules/server/server.js +0 -373
- package/core/modules/utils/base64-utf8/base64-utf8.module.js +0 -142
- package/core/modules/utils/base64-utf8/base64-utf8.module.min.js +0 -9
- package/core/modules/utils/base64-utf8/tiddlywiki.files +0 -14
- package/core/modules/utils/filesystem.js +0 -542
- package/core/modules/utils/repository.js +0 -46
- package/editions/d3demo/tiddlers/CloudData.tid +0 -44
- package/editions/d3demo/tiddlers/DefaultTiddlers.tid +0 -3
- package/editions/d3demo/tiddlers/GraphData.tid +0 -10
- package/editions/d3demo/tiddlers/HelloThere.tid +0 -17
- package/editions/d3demo/tiddlers/SiteSubtitle.tid +0 -3
- package/editions/d3demo/tiddlers/SiteTitle.tid +0 -3
- package/editions/d3demo/tiddlers/grouped.tid +0 -3
- package/editions/d3demo/tiddlers/spiral.tid +0 -3
- package/editions/d3demo/tiddlywiki.info +0 -16
- package/editions/fr-FR/tiddlers/community/resources/_savetiddlers_ Extension for Chrome and Firefox by buggyj.tid +0 -17
- package/editions/ja-JP/tiddlers/community/resources/_savetiddlers_ Extension for Chrome and Firefox by buggyj.tid +0 -18
- package/editions/ja-JP/tiddlers/hellothere/Welcome.tid +0 -8
- package/editions/ja-JP/tiddlers/hellothere/thumbnails/HelloThumbnail - Funding.tid +0 -10
- package/editions/tahoelafs/tiddlers/DefaultTiddlers.tid +0 -3
- package/editions/tahoelafs/tiddlers/HelloThere.tid +0 -6
- package/editions/tahoelafs/tiddlers/SiteSubtitle.tid +0 -3
- package/editions/tahoelafs/tiddlers/SiteTitle.tid +0 -3
- package/editions/tahoelafs/tiddlywiki.info +0 -14
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project.htm +0 -23430
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(1) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(10) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(11) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(12) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(13) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(14) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(15) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(16) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(17) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(18) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(19) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(2) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(20) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(21) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(22) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(23) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(24) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(3) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(4) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(5) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(6) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(7) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(8) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/SiteIcon(9) +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/app.css +0 -191
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/backstage.html +0 -95
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/backstage.js +0 -360
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/chrjs +0 -373
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/chrjs.identities +0 -42
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/chrjs.space +0 -108
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/chrjs.users +0 -57
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/help.png +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/jquery.js +0 -11
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/normalize.css +0 -406
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/publicIcon +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/search.png +0 -0
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/status.js +0 -2
- package/editions/tiddlywiki-surveys/great-interview-project-2010/The great TiddlyWiki interview project_files/ts.js +0 -766
- package/editions/tiddlywiki-surveys/great-interview-project-2010/readme.md +0 -3
- package/editions/tiddlywiki-surveys/tiddlers/$__StoryList.tid +0 -2
- package/editions/tw5.com/tiddlers/$__StoryList.tid +0 -5
- package/editions/tw5.com/tiddlers/community/Community Survey 2025 Sidebar Segment Styles.tid +0 -9
- package/editions/tw5.com/tiddlers/community/Community Survey 2025 Sidebar Segment.tid +0 -11
- package/editions/tw5.com/tiddlers/community/TiddlyWiki Newsletter Team.tid +0 -60
- package/editions/tw5.com/tiddlers/community/resources/_TWeb.at_ by Mario Pietsch.tid +0 -16
- package/editions/tw5.com/tiddlers/community/resources/_savetiddlers_ Extension for Chrome and Firefox by buggyj.tid +0 -16
- package/editions/tw5.com/tiddlers/definitions/TiddlyIE.tid +0 -9
- package/editions/tw5.com/tiddlers/gettingstarted/GettingStarted - Internet Explorer.tid +0 -10
- package/editions/tw5.com/tiddlers/hellothere/Welcome.tid +0 -7
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Funding.tid +0 -9
- package/editions/tw5.com/tiddlers/howtos/Windows HTA Hack.tid +0 -17
- package/editions/tw5.com/tiddlers/images/Community Survey 2025.png +0 -0
- package/editions/tw5.com/tiddlers/images/Community Survey 2025.png.meta +0 -6
- package/editions/tw5.com/tiddlers/images/Funding.png +0 -0
- package/editions/tw5.com/tiddlers/images/Funding.png.meta +0 -4
- package/editions/tw5.com/tiddlers/images/Intertwingled Innovations.png +0 -0
- package/editions/tw5.com/tiddlers/images/Intertwingled Innovations.png.meta +0 -3
- package/editions/tw5.com/tiddlers/images/MWS Banner.png +0 -0
- package/editions/tw5.com/tiddlers/images/MWS Banner.png.meta +0 -4
- package/editions/tw5.com/tiddlers/images/Marketplace Banner.png +0 -0
- package/editions/tw5.com/tiddlers/images/Marketplace Banner.png.meta +0 -4
- package/editions/tw5.com/tiddlers/images/New Release Banner.png +0 -0
- package/editions/tw5.com/tiddlers/images/New Release Banner.png.meta +0 -4
- package/editions/tw5.com/tiddlers/images/Tiddler Poster.png +0 -0
- package/editions/tw5.com/tiddlers/images/Tiddler Poster.png.meta +0 -5
- package/editions/tw5.com/tiddlers/images/TiddlyFox Apocalypse.png +0 -0
- package/editions/tw5.com/tiddlers/images/TiddlyFox Apocalypse.png.meta +0 -4
- package/editions/tw5.com/tiddlers/images/TiddlyWiki Classic.png +0 -0
- package/editions/tw5.com/tiddlers/images/TiddlyWiki Classic.png.meta +0 -4
- package/editions/tw5.com/tiddlers/images/TiddlyWiki Newsletter Badge.png +0 -0
- package/editions/tw5.com/tiddlers/images/TiddlyWiki Newsletter Badge.png.meta +0 -6
- package/editions/tw5.com/tiddlers/images/TiddlyWiki Privacy Badge.png +0 -0
- package/editions/tw5.com/tiddlers/images/TiddlyWiki Privacy Badge.png.meta +0 -6
- package/editions/tw5.com/tiddlers/images/Twenty Years of TiddlyWiki.png +0 -0
- package/editions/tw5.com/tiddlers/images/Twenty Years of TiddlyWiki.png.meta +0 -4
- package/editions/tw5.com/tiddlers/macros/syntax/MacroParameterValue.tid +0 -11
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.23.tid +0 -298
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.2.0.tid +0 -302
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.2.4.tid +0 -145
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.2.6.tid +0 -149
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.3.2.tid +0 -184
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.3.7.tid +0 -146
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.3.8.tid +0 -43
- package/editions/tw5.com/tiddlers/saving/Saving with TiddlyIE.tid +0 -25
- package/editions/tw5.com/tiddlers/variables/Behaviour of invoked variables depends on how the variable was declared.tid +0 -52
- package/eslint.config.js +0 -333
- package/languages/ja-JP/Types/application%2Fjavascript.tid +0 -4
- package/languages/ja-JP/Types/application%2Fjson.tid +0 -4
- package/languages/ja-JP/Types/application%2Fx-tiddler-dictionary.tid +0 -4
- package/languages/ja-JP/Types/image%2Fgif.tid +0 -4
- package/languages/ja-JP/Types/image%2Fjpeg.tid +0 -4
- package/languages/ja-JP/Types/image%2Fpng.tid +0 -4
- package/languages/ja-JP/Types/image%2Fsvg%2Bxml.tid +0 -4
- package/languages/ja-JP/Types/text%2Fcss.tid +0 -4
- package/languages/ja-JP/Types/text%2Fhtml.tid +0 -4
- package/languages/ja-JP/Types/text%2Fplain.tid +0 -4
- package/languages/ja-JP/Types/text%2Fvnd.tiddlywiki.tid +0 -4
- package/playwright-report/index.html +0 -77
- package/plugins/tiddlywiki/blog/docs.tid +0 -6
- package/plugins/tiddlywiki/blog/plugin.info +0 -7
- package/plugins/tiddlywiki/blog/readme.tid +0 -5
- package/plugins/tiddlywiki/blog/templates/html-page/page.tid +0 -31
- package/plugins/tiddlywiki/blog/templates/html-page/post.tid +0 -32
- package/plugins/tiddlywiki/blog/templates/menu.tid +0 -15
- package/plugins/tiddlywiki/blog/templates/tiddler.tid +0 -35
- package/plugins/tiddlywiki/cecily/cecily.js +0 -140
- package/plugins/tiddlywiki/cecily/plugin.info +0 -7
- package/plugins/tiddlywiki/cecily/readme.tid +0 -9
- package/plugins/tiddlywiki/cecily/storyview-cecily.tid +0 -8
- package/plugins/tiddlywiki/d3/barwidget.js +0 -199
- package/plugins/tiddlywiki/d3/base.tid +0 -18
- package/plugins/tiddlywiki/d3/cloudwidget.js +0 -128
- package/plugins/tiddlywiki/d3/files/LICENSE +0 -26
- package/plugins/tiddlywiki/d3/files/cloud/LICENSE +0 -26
- package/plugins/tiddlywiki/d3/files/cloud/d3.layout.cloud.js +0 -401
- package/plugins/tiddlywiki/d3/files/d3.min.js +0 -5
- package/plugins/tiddlywiki/d3/files/tiddlywiki.files +0 -22
- package/plugins/tiddlywiki/d3/plugin.info +0 -7
- package/plugins/tiddlywiki/d3/readme.tid +0 -7
- package/plugins/tiddlywiki/hammerjs/files/LICENSE.markdown +0 -21
- package/plugins/tiddlywiki/hammerjs/files/hammer.min.v2.0.8.js +0 -6
- package/plugins/tiddlywiki/hammerjs/files/tiddlywiki.files +0 -20
- package/plugins/tiddlywiki/hammerjs/plugin.info +0 -8
- package/plugins/tiddlywiki/hammerjs/readme.tid +0 -3
- package/plugins/tiddlywiki/highlight-legacy/TypeMappings.multids +0 -9
- package/plugins/tiddlywiki/highlight-legacy/files/default.css +0 -99
- package/plugins/tiddlywiki/highlight-legacy/files/highlight.pack.js +0 -2
- package/plugins/tiddlywiki/highlight-legacy/files/tiddlywiki.files +0 -22
- package/plugins/tiddlywiki/highlight-legacy/highlightblock.js +0 -38
- package/plugins/tiddlywiki/highlight-legacy/license.tid +0 -27
- package/plugins/tiddlywiki/highlight-legacy/plugin.info +0 -8
- package/plugins/tiddlywiki/highlight-legacy/readme.tid +0 -65
- package/plugins/tiddlywiki/highlight-legacy/styles.tid +0 -82
- package/plugins/tiddlywiki/highlight-legacy/usage.tid +0 -28
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Main-Bold.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Main-Italic.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Main-Regular.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Math-Italic.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Script-Regular.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/plugins/tiddlywiki/mobiledragdrop/files/LICENSE +0 -7
- package/plugins/tiddlywiki/mobiledragdrop/files/ios-drag-drop.js +0 -477
- package/plugins/tiddlywiki/mobiledragdrop/files/tiddlywiki.files +0 -18
- package/plugins/tiddlywiki/mobiledragdrop/plugin.info +0 -8
- package/plugins/tiddlywiki/mobiledragdrop/rawmarkup.tid +0 -7
- package/plugins/tiddlywiki/mobiledragdrop/readme.tid +0 -5
- package/plugins/tiddlywiki/mobiledragdrop/startup.js +0 -20
- package/plugins/tiddlywiki/nodewebkitsaver/nodewebkit.js +0 -59
- package/plugins/tiddlywiki/nodewebkitsaver/plugin.info +0 -7
- package/plugins/tiddlywiki/nodewebkitsaver/readme.tid +0 -5
- package/plugins/tiddlywiki/tahoelafs/plugin.info +0 -7
- package/plugins/tiddlywiki/tahoelafs/readme.tid +0 -7
- package/plugins/tiddlywiki/tahoelafs/saver.js +0 -52
- package/test-results/.last-run.json +0 -4
- /package/{core/modules → core-server}/commands/build.js +0 -0
- /package/{core/modules → core-server}/commands/clearpassword.js +0 -0
- /package/{core/modules → core-server}/commands/editions.js +0 -0
- /package/{core/modules → core-server}/commands/help.js +0 -0
- /package/{core/modules → core-server}/commands/makelibrary.js +0 -0
- /package/{core/modules → core-server}/commands/password.js +0 -0
- /package/{core/modules → core-server}/commands/rendertiddler.js +0 -0
- /package/{core/modules → core-server}/commands/savelibrarytiddlers.js +0 -0
- /package/{core/modules → core-server}/commands/savetiddler.js +0 -0
- /package/{core/modules → core-server}/commands/unpackplugin.js +0 -0
- /package/{core/modules → core-server}/commands/verbose.js +0 -0
- /package/{core/modules → core-server}/commands/version.js +0 -0
- /package/{core/modules → core-server}/server/authenticators/header.js +0 -0
- /package/{core/modules → core-server}/startup/commands.js +0 -0
- /package/{core/modules → core-server}/utils/edition-info.js +0 -0
- /package/editions/ja-JP/tiddlers/hiddensettings/{Hidden Setting_ Default Tiddler Icon.tid → Hidden Setting Default Tiddler Icon.tid} +0 -0
- /package/editions/ja-JP/tiddlers/howtos/{Custom Styles FAQ.tid → Custom_Styles_FAQ.tid} +0 -0
- /package/editions/ja-JP/tiddlers/howtos/{How to hide the author's and other fields with CSS.tid → How to hide the authors and other fields with CSS.tid} +0 -0
- /package/editions/ja-JP/tiddlers/howtos/{How to widen tiddlers (aka storyriver).tid → How to widen tiddlers (aka story river).tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.0.tid → pre-5.4.0/Release 5.1.0.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.1.tid → pre-5.4.0/Release 5.1.1.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.10.tid → pre-5.4.0/Release 5.1.10.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.11.tid → pre-5.4.0/Release 5.1.11.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.12.tid → pre-5.4.0/Release 5.1.12.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.13.tid → pre-5.4.0/Release 5.1.13.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.14.tid → pre-5.4.0/Release 5.1.14.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.15.tid → pre-5.4.0/Release 5.1.15.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.16.tid → pre-5.4.0/Release 5.1.16.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.17.tid → pre-5.4.0/Release 5.1.17.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.18.tid → pre-5.4.0/Release 5.1.18.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.19.tid → pre-5.4.0/Release 5.1.19.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.2.tid → pre-5.4.0/Release 5.1.2.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.20.tid → pre-5.4.0/Release 5.1.20.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.21.tid → pre-5.4.0/Release 5.1.21.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.22.tid → pre-5.4.0/Release 5.1.22.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.3.tid → pre-5.4.0/Release 5.1.3.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.4.tid → pre-5.4.0/Release 5.1.4.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.5.tid → pre-5.4.0/Release 5.1.5.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.6.tid → pre-5.4.0/Release 5.1.6.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.7.tid → pre-5.4.0/Release 5.1.7.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.8.tid → pre-5.4.0/Release 5.1.8.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.1.9.tid → pre-5.4.0/Release 5.1.9.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.2.1.tid → pre-5.4.0/Release 5.2.1.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.2.2.tid → pre-5.4.0/Release 5.2.2.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.2.3.tid → pre-5.4.0/Release 5.2.3.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.2.5.tid → pre-5.4.0/Release 5.2.5.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.2.7.tid → pre-5.4.0/Release 5.2.7.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.3.0.tid → pre-5.4.0/Release 5.3.0.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.3.1.tid → pre-5.4.0/Release 5.3.1.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.3.3.tid → pre-5.4.0/Release 5.3.3.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.3.4.tid → pre-5.4.0/Release 5.3.4.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.3.5.tid → pre-5.4.0/Release 5.3.5.tid} +0 -0
- /package/editions/tw5.com/tiddlers/releasenotes/{Release 5.3.6.tid → pre-5.4.0/Release 5.3.6.tid} +0 -0
|
@@ -1,248 +1,126 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// Number of seconds to map a diff before giving up (0 for infinity).
|
|
35
|
-
this.Diff_Timeout = 1.0;
|
|
36
|
-
// Cost of an empty edit operation in terms of edit characters.
|
|
37
|
-
this.Diff_EditCost = 4;
|
|
38
|
-
// At what point is no match declared (0.0 = perfection, 1.0 = very loose).
|
|
39
|
-
this.Match_Threshold = 0.5;
|
|
40
|
-
// How far to search for a match (0 = exact location, 1000+ = broad match).
|
|
41
|
-
// A match this many characters away from the expected location will add
|
|
42
|
-
// 1.0 to the score (0.0 is a perfect match).
|
|
43
|
-
this.Match_Distance = 1000;
|
|
44
|
-
// When deleting a large block of text (over ~64 characters), how close do
|
|
45
|
-
// the contents have to be to match the expected contents. (0.0 = perfection,
|
|
46
|
-
// 1.0 = very loose). Note that Match_Threshold controls how closely the
|
|
47
|
-
// end points of a delete need to match.
|
|
48
|
-
this.Patch_DeleteThreshold = 0.5;
|
|
49
|
-
// Chunk size for context length.
|
|
50
|
-
this.Patch_Margin = 4;
|
|
51
|
-
|
|
52
|
-
// The number of bits in an int.
|
|
53
|
-
this.Match_MaxBits = 32;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var __defProp$1 = Object.defineProperty;
|
|
4
|
+
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues$1 = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp$1.call(b, prop))
|
|
11
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols$1)
|
|
13
|
+
for (var prop of __getOwnPropSymbols$1(b)) {
|
|
14
|
+
if (__propIsEnum$1.call(b, prop))
|
|
15
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
const defaultOptions = /* @__PURE__ */ Object.freeze({
|
|
20
|
+
diffTimeout: 1,
|
|
21
|
+
diffEditCost: 4,
|
|
22
|
+
matchThreshold: 0.5,
|
|
23
|
+
matchDistance: 1e3,
|
|
24
|
+
patchDeleteThreshold: 0.5,
|
|
25
|
+
patchMargin: 4,
|
|
26
|
+
matchMaxBits: 32
|
|
27
|
+
});
|
|
28
|
+
function resolveOptions(options) {
|
|
29
|
+
if (options == null ? undefined : options.__resolved)
|
|
30
|
+
return options;
|
|
31
|
+
const resolved = __spreadValues$1(__spreadValues$1({}, defaultOptions), options);
|
|
32
|
+
Object.defineProperty(resolved, "__resolved", { value: true, enumerable: false });
|
|
33
|
+
return resolved;
|
|
54
34
|
}
|
|
55
35
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var DIFF_INSERT = 1;
|
|
67
|
-
var DIFF_EQUAL = 0;
|
|
68
|
-
|
|
69
|
-
/** @typedef {{0: number, 1: string}} */
|
|
70
|
-
diff_match_patch.Diff;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Find the differences between two texts. Simplifies the problem by stripping
|
|
75
|
-
* any common prefix or suffix off the texts before diffing.
|
|
76
|
-
* @param {string} text1 Old string to be diffed.
|
|
77
|
-
* @param {string} text2 New string to be diffed.
|
|
78
|
-
* @param {boolean=} opt_checklines Optional speedup flag. If present and false,
|
|
79
|
-
* then don't run a line-level diff first to identify the changed areas.
|
|
80
|
-
* Defaults to true, which does a faster, slightly less optimal diff.
|
|
81
|
-
* @param {number} opt_deadline Optional time when the diff should be complete
|
|
82
|
-
* by. Used internally for recursive calls. Users should set DiffTimeout
|
|
83
|
-
* instead.
|
|
84
|
-
* @return {!Array.<!diff_match_patch.Diff>} Array of diff tuples.
|
|
85
|
-
*/
|
|
86
|
-
diff_match_patch.prototype.diff_main = function(text1, text2, opt_checklines,
|
|
87
|
-
opt_deadline) {
|
|
88
|
-
// Set a deadline by which time the diff must be complete.
|
|
89
|
-
if (typeof opt_deadline == 'undefined') {
|
|
90
|
-
if (this.Diff_Timeout <= 0) {
|
|
36
|
+
const DIFF_DELETE = -1;
|
|
37
|
+
const DIFF_INSERT = 1;
|
|
38
|
+
const DIFF_EQUAL = 0;
|
|
39
|
+
function createDiff(op, text) {
|
|
40
|
+
return [op, text];
|
|
41
|
+
}
|
|
42
|
+
function diffMain(text1, text2, options, opt_checklines = true, opt_deadline) {
|
|
43
|
+
const resolved = resolveOptions(options);
|
|
44
|
+
if (typeof opt_deadline == "undefined") {
|
|
45
|
+
if (resolved.diffTimeout <= 0)
|
|
91
46
|
opt_deadline = Number.MAX_VALUE;
|
|
92
|
-
|
|
93
|
-
opt_deadline = (new Date).getTime() +
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Check for equality (speedup).
|
|
104
|
-
if (text1 == text2) {
|
|
105
|
-
if (text1) {
|
|
106
|
-
return [[DIFF_EQUAL, text1]];
|
|
107
|
-
}
|
|
47
|
+
else
|
|
48
|
+
opt_deadline = (/* @__PURE__ */ new Date()).getTime() + resolved.diffTimeout * 1e3;
|
|
49
|
+
}
|
|
50
|
+
const deadline = opt_deadline;
|
|
51
|
+
if (text1 == null || text2 == null)
|
|
52
|
+
throw new Error("Null input. (diff_main)");
|
|
53
|
+
if (text1 === text2) {
|
|
54
|
+
if (text1)
|
|
55
|
+
return [createDiff(DIFF_EQUAL, text1)];
|
|
108
56
|
return [];
|
|
109
57
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
var checklines = opt_checklines;
|
|
115
|
-
|
|
116
|
-
// Trim off common prefix (speedup).
|
|
117
|
-
var commonlength = this.diff_commonPrefix(text1, text2);
|
|
118
|
-
var commonprefix = text1.substring(0, commonlength);
|
|
58
|
+
const checklines = opt_checklines;
|
|
59
|
+
let commonlength = diffCommonPrefix(text1, text2);
|
|
60
|
+
const commonprefix = text1.substring(0, commonlength);
|
|
119
61
|
text1 = text1.substring(commonlength);
|
|
120
62
|
text2 = text2.substring(commonlength);
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
commonlength = this.diff_commonSuffix(text1, text2);
|
|
124
|
-
var commonsuffix = text1.substring(text1.length - commonlength);
|
|
63
|
+
commonlength = diffCommonSuffix(text1, text2);
|
|
64
|
+
const commonsuffix = text1.substring(text1.length - commonlength);
|
|
125
65
|
text1 = text1.substring(0, text1.length - commonlength);
|
|
126
66
|
text2 = text2.substring(0, text2.length - commonlength);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
diffs.unshift([DIFF_EQUAL, commonprefix]);
|
|
134
|
-
}
|
|
135
|
-
if (commonsuffix) {
|
|
136
|
-
diffs.push([DIFF_EQUAL, commonsuffix]);
|
|
137
|
-
}
|
|
138
|
-
this.diff_cleanupMerge(diffs);
|
|
67
|
+
const diffs = diffCompute(text1, text2, resolved, checklines, deadline);
|
|
68
|
+
if (commonprefix)
|
|
69
|
+
diffs.unshift(createDiff(DIFF_EQUAL, commonprefix));
|
|
70
|
+
if (commonsuffix)
|
|
71
|
+
diffs.push(createDiff(DIFF_EQUAL, commonsuffix));
|
|
72
|
+
diffCleanupMerge(diffs);
|
|
139
73
|
return diffs;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Find the differences between two texts. Assumes that the texts do not
|
|
145
|
-
* have any common prefix or suffix.
|
|
146
|
-
* @param {string} text1 Old string to be diffed.
|
|
147
|
-
* @param {string} text2 New string to be diffed.
|
|
148
|
-
* @param {boolean} checklines Speedup flag. If false, then don't run a
|
|
149
|
-
* line-level diff first to identify the changed areas.
|
|
150
|
-
* If true, then run a faster, slightly less optimal diff.
|
|
151
|
-
* @param {number} deadline Time when the diff should be complete by.
|
|
152
|
-
* @return {!Array.<!diff_match_patch.Diff>} Array of diff tuples.
|
|
153
|
-
* @private
|
|
154
|
-
*/
|
|
155
|
-
diff_match_patch.prototype.diff_compute_ = function(text1, text2, checklines,
|
|
156
|
-
deadline) {
|
|
157
|
-
var diffs;
|
|
158
|
-
|
|
74
|
+
}
|
|
75
|
+
function diffCompute(text1, text2, options, checklines, deadline) {
|
|
76
|
+
let diffs;
|
|
159
77
|
if (!text1) {
|
|
160
|
-
|
|
161
|
-
return [[DIFF_INSERT, text2]];
|
|
78
|
+
return [createDiff(DIFF_INSERT, text2)];
|
|
162
79
|
}
|
|
163
|
-
|
|
164
80
|
if (!text2) {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
// Shorter text is inside the longer text (speedup).
|
|
174
|
-
diffs = [[DIFF_INSERT, longtext.substring(0, i)],
|
|
175
|
-
[DIFF_EQUAL, shorttext],
|
|
176
|
-
[DIFF_INSERT, longtext.substring(i + shorttext.length)]];
|
|
177
|
-
// Swap insertions for deletions if diff is reversed.
|
|
178
|
-
if (text1.length > text2.length) {
|
|
81
|
+
return [createDiff(DIFF_DELETE, text1)];
|
|
82
|
+
}
|
|
83
|
+
const longtext = text1.length > text2.length ? text1 : text2;
|
|
84
|
+
const shorttext = text1.length > text2.length ? text2 : text1;
|
|
85
|
+
const i = longtext.indexOf(shorttext);
|
|
86
|
+
if (i !== -1) {
|
|
87
|
+
diffs = [createDiff(DIFF_INSERT, longtext.substring(0, i)), createDiff(DIFF_EQUAL, shorttext), createDiff(DIFF_INSERT, longtext.substring(i + shorttext.length))];
|
|
88
|
+
if (text1.length > text2.length)
|
|
179
89
|
diffs[0][0] = diffs[2][0] = DIFF_DELETE;
|
|
180
|
-
}
|
|
181
90
|
return diffs;
|
|
182
91
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
// Single character string.
|
|
186
|
-
// After the previous speedup, the character can't be an equality.
|
|
187
|
-
return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
|
|
92
|
+
if (shorttext.length === 1) {
|
|
93
|
+
return [createDiff(DIFF_DELETE, text1), createDiff(DIFF_INSERT, text2)];
|
|
188
94
|
}
|
|
189
|
-
|
|
190
|
-
// Check to see if the problem can be split in two.
|
|
191
|
-
var hm = this.diff_halfMatch_(text1, text2);
|
|
95
|
+
const hm = diffHalfMatch(text1, text2, options);
|
|
192
96
|
if (hm) {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
return this.diff_bisect_(text1, text2, deadline);
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Do a quick line-level diff on both strings, then rediff the parts for
|
|
216
|
-
* greater accuracy.
|
|
217
|
-
* This speedup can produce non-minimal diffs.
|
|
218
|
-
* @param {string} text1 Old string to be diffed.
|
|
219
|
-
* @param {string} text2 New string to be diffed.
|
|
220
|
-
* @param {number} deadline Time when the diff should be complete by.
|
|
221
|
-
* @return {!Array.<!diff_match_patch.Diff>} Array of diff tuples.
|
|
222
|
-
* @private
|
|
223
|
-
*/
|
|
224
|
-
diff_match_patch.prototype.diff_lineMode_ = function(text1, text2, deadline) {
|
|
225
|
-
// Scan the text on a line-by-line basis first.
|
|
226
|
-
var a = this.diff_linesToChars_(text1, text2);
|
|
97
|
+
const text1_a = hm[0];
|
|
98
|
+
const text1_b = hm[1];
|
|
99
|
+
const text2_a = hm[2];
|
|
100
|
+
const text2_b = hm[3];
|
|
101
|
+
const mid_common = hm[4];
|
|
102
|
+
const diffs_a = diffMain(text1_a, text2_a, options, checklines, deadline);
|
|
103
|
+
const diffs_b = diffMain(text1_b, text2_b, options, checklines, deadline);
|
|
104
|
+
return diffs_a.concat([createDiff(DIFF_EQUAL, mid_common)], diffs_b);
|
|
105
|
+
}
|
|
106
|
+
if (checklines && text1.length > 100 && text2.length > 100)
|
|
107
|
+
return diffLineMode(text1, text2, options, deadline);
|
|
108
|
+
return diffBisect(text1, text2, options, deadline);
|
|
109
|
+
}
|
|
110
|
+
function diffLineMode(text1, text2, options, deadline) {
|
|
111
|
+
const a = diffLinesToChars(text1, text2);
|
|
227
112
|
text1 = a.chars1;
|
|
228
113
|
text2 = a.chars2;
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
// Add a dummy entry at the end.
|
|
240
|
-
diffs.push([DIFF_EQUAL, '']);
|
|
241
|
-
var pointer = 0;
|
|
242
|
-
var count_delete = 0;
|
|
243
|
-
var count_insert = 0;
|
|
244
|
-
var text_delete = '';
|
|
245
|
-
var text_insert = '';
|
|
114
|
+
const linearray = a.lineArray;
|
|
115
|
+
const diffs = diffMain(text1, text2, options, false, deadline);
|
|
116
|
+
diffCharsToLines(diffs, linearray);
|
|
117
|
+
diffCleanupSemantic(diffs);
|
|
118
|
+
diffs.push(createDiff(DIFF_EQUAL, ""));
|
|
119
|
+
let pointer = 0;
|
|
120
|
+
let count_delete = 0;
|
|
121
|
+
let count_insert = 0;
|
|
122
|
+
let text_delete = "";
|
|
123
|
+
let text_insert = "";
|
|
246
124
|
while (pointer < diffs.length) {
|
|
247
125
|
switch (diffs[pointer][0]) {
|
|
248
126
|
case DIFF_INSERT:
|
|
@@ -254,282 +132,169 @@ diff_match_patch.prototype.diff_lineMode_ = function(text1, text2, deadline) {
|
|
|
254
132
|
text_delete += diffs[pointer][1];
|
|
255
133
|
break;
|
|
256
134
|
case DIFF_EQUAL:
|
|
257
|
-
// Upon reaching an equality, check for prior redundancies.
|
|
258
135
|
if (count_delete >= 1 && count_insert >= 1) {
|
|
259
|
-
|
|
260
|
-
diffs.splice(pointer - count_delete - count_insert,
|
|
261
|
-
count_delete + count_insert);
|
|
136
|
+
diffs.splice(pointer - count_delete - count_insert, count_delete + count_insert);
|
|
262
137
|
pointer = pointer - count_delete - count_insert;
|
|
263
|
-
|
|
264
|
-
for (
|
|
265
|
-
diffs.splice(pointer, 0,
|
|
266
|
-
|
|
267
|
-
pointer = pointer + a.length;
|
|
138
|
+
const subDiff = diffMain(text_delete, text_insert, options, false, deadline);
|
|
139
|
+
for (let j = subDiff.length - 1; j >= 0; j--)
|
|
140
|
+
diffs.splice(pointer, 0, subDiff[j]);
|
|
141
|
+
pointer = pointer + subDiff.length;
|
|
268
142
|
}
|
|
269
143
|
count_insert = 0;
|
|
270
144
|
count_delete = 0;
|
|
271
|
-
text_delete =
|
|
272
|
-
text_insert =
|
|
145
|
+
text_delete = "";
|
|
146
|
+
text_insert = "";
|
|
273
147
|
break;
|
|
274
148
|
}
|
|
275
149
|
pointer++;
|
|
276
150
|
}
|
|
277
|
-
diffs.pop();
|
|
278
|
-
|
|
151
|
+
diffs.pop();
|
|
279
152
|
return diffs;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
* @return {!Array.<!diff_match_patch.Diff>} Array of diff tuples.
|
|
291
|
-
* @private
|
|
292
|
-
*/
|
|
293
|
-
diff_match_patch.prototype.diff_bisect_ = function(text1, text2, deadline) {
|
|
294
|
-
// Cache the text lengths to prevent multiple calls.
|
|
295
|
-
var text1_length = text1.length;
|
|
296
|
-
var text2_length = text2.length;
|
|
297
|
-
var max_d = Math.ceil((text1_length + text2_length) / 2);
|
|
298
|
-
var v_offset = max_d;
|
|
299
|
-
var v_length = 2 * max_d;
|
|
300
|
-
var v1 = new Array(v_length);
|
|
301
|
-
var v2 = new Array(v_length);
|
|
302
|
-
// Setting all elements to -1 is faster in Chrome & Firefox than mixing
|
|
303
|
-
// integers and undefined.
|
|
304
|
-
for (var x = 0; x < v_length; x++) {
|
|
153
|
+
}
|
|
154
|
+
function diffBisect(text1, text2, options, deadline) {
|
|
155
|
+
const text1_length = text1.length;
|
|
156
|
+
const text2_length = text2.length;
|
|
157
|
+
const max_d = Math.ceil((text1_length + text2_length) / 2);
|
|
158
|
+
const v_offset = max_d;
|
|
159
|
+
const v_length = 2 * max_d;
|
|
160
|
+
const v1 = new Array(v_length);
|
|
161
|
+
const v2 = new Array(v_length);
|
|
162
|
+
for (let x = 0; x < v_length; x++) {
|
|
305
163
|
v1[x] = -1;
|
|
306
164
|
v2[x] = -1;
|
|
307
165
|
}
|
|
308
166
|
v1[v_offset + 1] = 0;
|
|
309
167
|
v2[v_offset + 1] = 0;
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
var k2start = 0;
|
|
319
|
-
var k2end = 0;
|
|
320
|
-
for (var d = 0; d < max_d; d++) {
|
|
321
|
-
// Bail out if deadline is reached.
|
|
322
|
-
if ((new Date()).getTime() > deadline) {
|
|
168
|
+
const delta = text1_length - text2_length;
|
|
169
|
+
const front = delta % 2 !== 0;
|
|
170
|
+
let k1start = 0;
|
|
171
|
+
let k1end = 0;
|
|
172
|
+
let k2start = 0;
|
|
173
|
+
let k2end = 0;
|
|
174
|
+
for (let d = 0; d < max_d; d++) {
|
|
175
|
+
if ((/* @__PURE__ */ new Date()).getTime() > deadline)
|
|
323
176
|
break;
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
var k1_offset = v_offset + k1;
|
|
329
|
-
var x1;
|
|
330
|
-
if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {
|
|
177
|
+
for (let k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
|
|
178
|
+
const k1_offset = v_offset + k1;
|
|
179
|
+
let x1;
|
|
180
|
+
if (k1 === -d || k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])
|
|
331
181
|
x1 = v1[k1_offset + 1];
|
|
332
|
-
|
|
182
|
+
else
|
|
333
183
|
x1 = v1[k1_offset - 1] + 1;
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
while (x1 < text1_length && y1 < text2_length &&
|
|
337
|
-
text1.charAt(x1) == text2.charAt(y1)) {
|
|
184
|
+
let y1 = x1 - k1;
|
|
185
|
+
while (x1 < text1_length && y1 < text2_length && text1.charAt(x1) === text2.charAt(y1)) {
|
|
338
186
|
x1++;
|
|
339
187
|
y1++;
|
|
340
188
|
}
|
|
341
189
|
v1[k1_offset] = x1;
|
|
342
190
|
if (x1 > text1_length) {
|
|
343
|
-
// Ran off the right of the graph.
|
|
344
191
|
k1end += 2;
|
|
345
192
|
} else if (y1 > text2_length) {
|
|
346
|
-
// Ran off the bottom of the graph.
|
|
347
193
|
k1start += 2;
|
|
348
194
|
} else if (front) {
|
|
349
|
-
|
|
350
|
-
if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset]
|
|
351
|
-
|
|
352
|
-
var x2 = text1_length - v2[k2_offset];
|
|
195
|
+
const k2_offset = v_offset + delta - k1;
|
|
196
|
+
if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {
|
|
197
|
+
const x2 = text1_length - v2[k2_offset];
|
|
353
198
|
if (x1 >= x2) {
|
|
354
|
-
|
|
355
|
-
return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);
|
|
199
|
+
return diffBisectSplit(text1, text2, options, x1, y1, deadline);
|
|
356
200
|
}
|
|
357
201
|
}
|
|
358
202
|
}
|
|
359
203
|
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
var x2;
|
|
365
|
-
if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {
|
|
204
|
+
for (let k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
|
|
205
|
+
const k2_offset = v_offset + k2;
|
|
206
|
+
let x2;
|
|
207
|
+
if (k2 === -d || k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])
|
|
366
208
|
x2 = v2[k2_offset + 1];
|
|
367
|
-
|
|
209
|
+
else
|
|
368
210
|
x2 = v2[k2_offset - 1] + 1;
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
while (x2 < text1_length && y2 < text2_length &&
|
|
372
|
-
text1.charAt(text1_length - x2 - 1) ==
|
|
373
|
-
text2.charAt(text2_length - y2 - 1)) {
|
|
211
|
+
let y2 = x2 - k2;
|
|
212
|
+
while (x2 < text1_length && y2 < text2_length && text1.charAt(text1_length - x2 - 1) === text2.charAt(text2_length - y2 - 1)) {
|
|
374
213
|
x2++;
|
|
375
214
|
y2++;
|
|
376
215
|
}
|
|
377
216
|
v2[k2_offset] = x2;
|
|
378
217
|
if (x2 > text1_length) {
|
|
379
|
-
// Ran off the left of the graph.
|
|
380
218
|
k2end += 2;
|
|
381
219
|
} else if (y2 > text2_length) {
|
|
382
|
-
// Ran off the top of the graph.
|
|
383
220
|
k2start += 2;
|
|
384
221
|
} else if (!front) {
|
|
385
|
-
|
|
386
|
-
if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset]
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
// Mirror x2 onto top-left coordinate system.
|
|
222
|
+
const k1_offset = v_offset + delta - k2;
|
|
223
|
+
if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {
|
|
224
|
+
const x1 = v1[k1_offset];
|
|
225
|
+
const y1 = v_offset + x1 - k1_offset;
|
|
390
226
|
x2 = text1_length - x2;
|
|
391
227
|
if (x1 >= x2) {
|
|
392
|
-
|
|
393
|
-
return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);
|
|
228
|
+
return diffBisectSplit(text1, text2, options, x1, y1, deadline);
|
|
394
229
|
}
|
|
395
230
|
}
|
|
396
231
|
}
|
|
397
232
|
}
|
|
398
233
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
* @param {string} text1 Old string to be diffed.
|
|
409
|
-
* @param {string} text2 New string to be diffed.
|
|
410
|
-
* @param {number} x Index of split point in text1.
|
|
411
|
-
* @param {number} y Index of split point in text2.
|
|
412
|
-
* @param {number} deadline Time at which to bail if not yet complete.
|
|
413
|
-
* @return {!Array.<!diff_match_patch.Diff>} Array of diff tuples.
|
|
414
|
-
* @private
|
|
415
|
-
*/
|
|
416
|
-
diff_match_patch.prototype.diff_bisectSplit_ = function(text1, text2, x, y,
|
|
417
|
-
deadline) {
|
|
418
|
-
var text1a = text1.substring(0, x);
|
|
419
|
-
var text2a = text2.substring(0, y);
|
|
420
|
-
var text1b = text1.substring(x);
|
|
421
|
-
var text2b = text2.substring(y);
|
|
422
|
-
|
|
423
|
-
// Compute both diffs serially.
|
|
424
|
-
var diffs = this.diff_main(text1a, text2a, false, deadline);
|
|
425
|
-
var diffsb = this.diff_main(text1b, text2b, false, deadline);
|
|
426
|
-
|
|
234
|
+
return [createDiff(DIFF_DELETE, text1), createDiff(DIFF_INSERT, text2)];
|
|
235
|
+
}
|
|
236
|
+
function diffBisectSplit(text1, text2, options, x, y, deadline) {
|
|
237
|
+
const text1a = text1.substring(0, x);
|
|
238
|
+
const text2a = text2.substring(0, y);
|
|
239
|
+
const text1b = text1.substring(x);
|
|
240
|
+
const text2b = text2.substring(y);
|
|
241
|
+
const diffs = diffMain(text1a, text2a, options, false, deadline);
|
|
242
|
+
const diffsb = diffMain(text1b, text2b, options, false, deadline);
|
|
427
243
|
return diffs.concat(diffsb);
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
* The zeroth element of the array of unique strings is intentionally blank.
|
|
440
|
-
* @private
|
|
441
|
-
*/
|
|
442
|
-
diff_match_patch.prototype.diff_linesToChars_ = function(text1, text2) {
|
|
443
|
-
var lineArray = []; // e.g. lineArray[4] == 'Hello\n'
|
|
444
|
-
var lineHash = {}; // e.g. lineHash['Hello\n'] == 4
|
|
445
|
-
|
|
446
|
-
// '\x00' is a valid character, but various debuggers don't like it.
|
|
447
|
-
// So we'll insert a junk entry to avoid generating a null character.
|
|
448
|
-
lineArray[0] = '';
|
|
449
|
-
|
|
450
|
-
/**
|
|
451
|
-
* Split a text into an array of strings. Reduce the texts to a string of
|
|
452
|
-
* hashes where each Unicode character represents one line.
|
|
453
|
-
* Modifies linearray and linehash through being a closure.
|
|
454
|
-
* @param {string} text String to encode.
|
|
455
|
-
* @return {string} Encoded string.
|
|
456
|
-
* @private
|
|
457
|
-
*/
|
|
458
|
-
function diff_linesToCharsMunge_(text) {
|
|
459
|
-
var chars = '';
|
|
460
|
-
// Walk the text, pulling out a substring for each line.
|
|
461
|
-
// text.split('\n') would would temporarily double our memory footprint.
|
|
462
|
-
// Modifying text would create many large strings to garbage collect.
|
|
463
|
-
var lineStart = 0;
|
|
464
|
-
var lineEnd = -1;
|
|
465
|
-
// Keeping our own length variable is faster than looking it up.
|
|
466
|
-
var lineArrayLength = lineArray.length;
|
|
244
|
+
}
|
|
245
|
+
function diffLinesToChars(text1, text2) {
|
|
246
|
+
const lineArray = [];
|
|
247
|
+
const lineHash = {};
|
|
248
|
+
let maxLines = 4e4;
|
|
249
|
+
lineArray[0] = "";
|
|
250
|
+
function diffLinesToCharsMunge(text) {
|
|
251
|
+
let chars = "";
|
|
252
|
+
let lineStart = 0;
|
|
253
|
+
let lineEnd = -1;
|
|
254
|
+
let lineArrayLength = lineArray.length;
|
|
467
255
|
while (lineEnd < text.length - 1) {
|
|
468
|
-
lineEnd = text.indexOf(
|
|
469
|
-
if (lineEnd
|
|
256
|
+
lineEnd = text.indexOf("\n", lineStart);
|
|
257
|
+
if (lineEnd === -1)
|
|
470
258
|
lineEnd = text.length - 1;
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
lineStart = lineEnd + 1;
|
|
474
|
-
|
|
475
|
-
if (lineHash.hasOwnProperty ? lineHash.hasOwnProperty(line) :
|
|
476
|
-
(lineHash[line] !== undefined)) {
|
|
259
|
+
let line = text.substring(lineStart, lineEnd + 1);
|
|
260
|
+
if (lineHash.hasOwnProperty ? Object.prototype.hasOwnProperty.call(lineHash, line) : lineHash[line] !== undefined) {
|
|
477
261
|
chars += String.fromCharCode(lineHash[line]);
|
|
478
262
|
} else {
|
|
263
|
+
if (lineArrayLength === maxLines) {
|
|
264
|
+
line = text.substring(lineStart);
|
|
265
|
+
lineEnd = text.length;
|
|
266
|
+
}
|
|
479
267
|
chars += String.fromCharCode(lineArrayLength);
|
|
480
268
|
lineHash[line] = lineArrayLength;
|
|
481
269
|
lineArray[lineArrayLength++] = line;
|
|
482
270
|
}
|
|
271
|
+
lineStart = lineEnd + 1;
|
|
483
272
|
}
|
|
484
273
|
return chars;
|
|
485
274
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
return {
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
* @private
|
|
499
|
-
*/
|
|
500
|
-
diff_match_patch.prototype.diff_charsToLines_ = function(diffs, lineArray) {
|
|
501
|
-
for (var x = 0; x < diffs.length; x++) {
|
|
502
|
-
var chars = diffs[x][1];
|
|
503
|
-
var text = [];
|
|
504
|
-
for (var y = 0; y < chars.length; y++) {
|
|
505
|
-
text[y] = lineArray[chars.charCodeAt(y)];
|
|
506
|
-
}
|
|
507
|
-
diffs[x][1] = text.join('');
|
|
275
|
+
const chars1 = diffLinesToCharsMunge(text1);
|
|
276
|
+
maxLines = 65535;
|
|
277
|
+
const chars2 = diffLinesToCharsMunge(text2);
|
|
278
|
+
return { chars1, chars2, lineArray };
|
|
279
|
+
}
|
|
280
|
+
function diffCharsToLines(diffs, lineArray) {
|
|
281
|
+
for (let i = 0; i < diffs.length; i++) {
|
|
282
|
+
const chars = diffs[i][1];
|
|
283
|
+
const text = [];
|
|
284
|
+
for (let j = 0; j < chars.length; j++)
|
|
285
|
+
text[j] = lineArray[chars.charCodeAt(j)];
|
|
286
|
+
diffs[i][1] = text.join("");
|
|
508
287
|
}
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
/**
|
|
513
|
-
* Determine the common prefix of two strings.
|
|
514
|
-
* @param {string} text1 First string.
|
|
515
|
-
* @param {string} text2 Second string.
|
|
516
|
-
* @return {number} The number of characters common to the start of each
|
|
517
|
-
* string.
|
|
518
|
-
*/
|
|
519
|
-
diff_match_patch.prototype.diff_commonPrefix = function(text1, text2) {
|
|
520
|
-
// Quick check for common null cases.
|
|
521
|
-
if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {
|
|
288
|
+
}
|
|
289
|
+
function diffCommonPrefix(text1, text2) {
|
|
290
|
+
if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0))
|
|
522
291
|
return 0;
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
var pointermax = Math.min(text1.length, text2.length);
|
|
528
|
-
var pointermid = pointermax;
|
|
529
|
-
var pointerstart = 0;
|
|
292
|
+
let pointermin = 0;
|
|
293
|
+
let pointermax = Math.min(text1.length, text2.length);
|
|
294
|
+
let pointermid = pointermax;
|
|
295
|
+
let pointerstart = 0;
|
|
530
296
|
while (pointermin < pointermid) {
|
|
531
|
-
if (text1.substring(pointerstart, pointermid)
|
|
532
|
-
text2.substring(pointerstart, pointermid)) {
|
|
297
|
+
if (text1.substring(pointerstart, pointermid) === text2.substring(pointerstart, pointermid)) {
|
|
533
298
|
pointermin = pointermid;
|
|
534
299
|
pointerstart = pointermin;
|
|
535
300
|
} else {
|
|
@@ -538,30 +303,17 @@ diff_match_patch.prototype.diff_commonPrefix = function(text1, text2) {
|
|
|
538
303
|
pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
|
|
539
304
|
}
|
|
540
305
|
return pointermid;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
/**
|
|
545
|
-
* Determine the common suffix of two strings.
|
|
546
|
-
* @param {string} text1 First string.
|
|
547
|
-
* @param {string} text2 Second string.
|
|
548
|
-
* @return {number} The number of characters common to the end of each string.
|
|
549
|
-
*/
|
|
550
|
-
diff_match_patch.prototype.diff_commonSuffix = function(text1, text2) {
|
|
551
|
-
// Quick check for common null cases.
|
|
552
|
-
if (!text1 || !text2 ||
|
|
553
|
-
text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {
|
|
306
|
+
}
|
|
307
|
+
function diffCommonSuffix(text1, text2) {
|
|
308
|
+
if (!text1 || !text2 || text1.charAt(text1.length - 1) !== text2.charAt(text2.length - 1)) {
|
|
554
309
|
return 0;
|
|
555
310
|
}
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
var pointermid = pointermax;
|
|
561
|
-
var pointerend = 0;
|
|
311
|
+
let pointermin = 0;
|
|
312
|
+
let pointermax = Math.min(text1.length, text2.length);
|
|
313
|
+
let pointermid = pointermax;
|
|
314
|
+
let pointerend = 0;
|
|
562
315
|
while (pointermin < pointermid) {
|
|
563
|
-
if (text1.substring(text1.length - pointermid, text1.length - pointerend)
|
|
564
|
-
text2.substring(text2.length - pointermid, text2.length - pointerend)) {
|
|
316
|
+
if (text1.substring(text1.length - pointermid, text1.length - pointerend) === text2.substring(text2.length - pointermid, text2.length - pointerend)) {
|
|
565
317
|
pointermin = pointermid;
|
|
566
318
|
pointerend = pointermin;
|
|
567
319
|
} else {
|
|
@@ -570,128 +322,65 @@ diff_match_patch.prototype.diff_commonSuffix = function(text1, text2) {
|
|
|
570
322
|
pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
|
|
571
323
|
}
|
|
572
324
|
return pointermid;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
* @param {string} text1 First string.
|
|
579
|
-
* @param {string} text2 Second string.
|
|
580
|
-
* @return {number} The number of characters common to the end of the first
|
|
581
|
-
* string and the start of the second string.
|
|
582
|
-
* @private
|
|
583
|
-
*/
|
|
584
|
-
diff_match_patch.prototype.diff_commonOverlap_ = function(text1, text2) {
|
|
585
|
-
// Cache the text lengths to prevent multiple calls.
|
|
586
|
-
var text1_length = text1.length;
|
|
587
|
-
var text2_length = text2.length;
|
|
588
|
-
// Eliminate the null case.
|
|
589
|
-
if (text1_length == 0 || text2_length == 0) {
|
|
325
|
+
}
|
|
326
|
+
function diffCommonOverlap(text1, text2) {
|
|
327
|
+
const text1_length = text1.length;
|
|
328
|
+
const text2_length = text2.length;
|
|
329
|
+
if (text1_length === 0 || text2_length === 0)
|
|
590
330
|
return 0;
|
|
591
|
-
|
|
592
|
-
// Truncate the longer string.
|
|
593
|
-
if (text1_length > text2_length) {
|
|
331
|
+
if (text1_length > text2_length)
|
|
594
332
|
text1 = text1.substring(text1_length - text2_length);
|
|
595
|
-
|
|
333
|
+
else if (text1_length < text2_length)
|
|
596
334
|
text2 = text2.substring(0, text1_length);
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
// Quick check for the worst case.
|
|
600
|
-
if (text1 == text2) {
|
|
335
|
+
const text_length = Math.min(text1_length, text2_length);
|
|
336
|
+
if (text1 === text2)
|
|
601
337
|
return text_length;
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
// Start by looking for a single character match
|
|
605
|
-
// and increase length until no match is found.
|
|
606
|
-
// Performance analysis: http://neil.fraser.name/news/2010/11/04/
|
|
607
|
-
var best = 0;
|
|
608
|
-
var length = 1;
|
|
338
|
+
let best = 0;
|
|
339
|
+
let length = 1;
|
|
609
340
|
while (true) {
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
if (found
|
|
341
|
+
const pattern = text1.substring(text_length - length);
|
|
342
|
+
const found = text2.indexOf(pattern);
|
|
343
|
+
if (found === -1)
|
|
613
344
|
return best;
|
|
614
|
-
}
|
|
615
345
|
length += found;
|
|
616
|
-
if (found
|
|
617
|
-
text2.substring(0, length)) {
|
|
346
|
+
if (found === 0 || text1.substring(text_length - length) === text2.substring(0, length)) {
|
|
618
347
|
best = length;
|
|
619
348
|
length++;
|
|
620
349
|
}
|
|
621
350
|
}
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
/**
|
|
626
|
-
* Do the two texts share a substring which is at least half the length of the
|
|
627
|
-
* longer text?
|
|
628
|
-
* This speedup can produce non-minimal diffs.
|
|
629
|
-
* @param {string} text1 First string.
|
|
630
|
-
* @param {string} text2 Second string.
|
|
631
|
-
* @return {Array.<string>} Five element Array, containing the prefix of
|
|
632
|
-
* text1, the suffix of text1, the prefix of text2, the suffix of
|
|
633
|
-
* text2 and the common middle. Or null if there was no match.
|
|
634
|
-
* @private
|
|
635
|
-
*/
|
|
636
|
-
diff_match_patch.prototype.diff_halfMatch_ = function(text1, text2) {
|
|
637
|
-
if (this.Diff_Timeout <= 0) {
|
|
638
|
-
// Don't risk returning a non-optimal diff if we have unlimited time.
|
|
351
|
+
}
|
|
352
|
+
function diffHalfMatch(text1, text2, options) {
|
|
353
|
+
if (options.diffTimeout <= 0) {
|
|
639
354
|
return null;
|
|
640
355
|
}
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
if (longtext.length < 4 || shorttext.length * 2 < longtext.length)
|
|
644
|
-
return null;
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
* @param {string} shorttext Shorter string.
|
|
654
|
-
* @param {number} i Start index of quarter length substring within longtext.
|
|
655
|
-
* @return {Array.<string>} Five element Array, containing the prefix of
|
|
656
|
-
* longtext, the suffix of longtext, the prefix of shorttext, the suffix
|
|
657
|
-
* of shorttext and the common middle. Or null if there was no match.
|
|
658
|
-
* @private
|
|
659
|
-
*/
|
|
660
|
-
function diff_halfMatchI_(longtext, shorttext, i) {
|
|
661
|
-
// Start with a 1/4 length substring at position i as a seed.
|
|
662
|
-
var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));
|
|
663
|
-
var j = -1;
|
|
664
|
-
var best_common = '';
|
|
665
|
-
var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
|
|
666
|
-
while ((j = shorttext.indexOf(seed, j + 1)) != -1) {
|
|
667
|
-
var prefixLength = dmp.diff_commonPrefix(longtext.substring(i),
|
|
668
|
-
shorttext.substring(j));
|
|
669
|
-
var suffixLength = dmp.diff_commonSuffix(longtext.substring(0, i),
|
|
670
|
-
shorttext.substring(0, j));
|
|
356
|
+
const longtext = text1.length > text2.length ? text1 : text2;
|
|
357
|
+
const shorttext = text1.length > text2.length ? text2 : text1;
|
|
358
|
+
if (longtext.length < 4 || shorttext.length * 2 < longtext.length)
|
|
359
|
+
return null;
|
|
360
|
+
function diffHalfMatchI(longtext2, shorttext2, i) {
|
|
361
|
+
const seed = longtext2.substring(i, i + Math.floor(longtext2.length / 4));
|
|
362
|
+
let j = -1;
|
|
363
|
+
let best_common = "";
|
|
364
|
+
let best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
|
|
365
|
+
while ((j = shorttext2.indexOf(seed, j + 1)) !== -1) {
|
|
366
|
+
const prefixLength = diffCommonPrefix(longtext2.substring(i), shorttext2.substring(j));
|
|
367
|
+
const suffixLength = diffCommonSuffix(longtext2.substring(0, i), shorttext2.substring(0, j));
|
|
671
368
|
if (best_common.length < suffixLength + prefixLength) {
|
|
672
|
-
best_common =
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
best_shorttext_b = shorttext.substring(j + prefixLength);
|
|
369
|
+
best_common = shorttext2.substring(j - suffixLength, j) + shorttext2.substring(j, j + prefixLength);
|
|
370
|
+
best_longtext_a = longtext2.substring(0, i - suffixLength);
|
|
371
|
+
best_longtext_b = longtext2.substring(i + prefixLength);
|
|
372
|
+
best_shorttext_a = shorttext2.substring(0, j - suffixLength);
|
|
373
|
+
best_shorttext_b = shorttext2.substring(j + prefixLength);
|
|
678
374
|
}
|
|
679
375
|
}
|
|
680
|
-
if (best_common.length * 2 >=
|
|
681
|
-
return [best_longtext_a, best_longtext_b,
|
|
682
|
-
|
|
683
|
-
} else {
|
|
376
|
+
if (best_common.length * 2 >= longtext2.length)
|
|
377
|
+
return [best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b, best_common];
|
|
378
|
+
else
|
|
684
379
|
return null;
|
|
685
|
-
}
|
|
686
380
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
Math.ceil(longtext.length / 4));
|
|
691
|
-
// Check again based on the third quarter.
|
|
692
|
-
var hm2 = diff_halfMatchI_(longtext, shorttext,
|
|
693
|
-
Math.ceil(longtext.length / 2));
|
|
694
|
-
var hm;
|
|
381
|
+
const hm1 = diffHalfMatchI(longtext, shorttext, Math.ceil(longtext.length / 4));
|
|
382
|
+
const hm2 = diffHalfMatchI(longtext, shorttext, Math.ceil(longtext.length / 2));
|
|
383
|
+
let hm;
|
|
695
384
|
if (!hm1 && !hm2) {
|
|
696
385
|
return null;
|
|
697
386
|
} else if (!hm2) {
|
|
@@ -699,12 +388,9 @@ diff_match_patch.prototype.diff_halfMatch_ = function(text1, text2) {
|
|
|
699
388
|
} else if (!hm1) {
|
|
700
389
|
hm = hm2;
|
|
701
390
|
} else {
|
|
702
|
-
// Both matched. Select the longest.
|
|
703
391
|
hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
|
|
704
392
|
}
|
|
705
|
-
|
|
706
|
-
// A half-match was found, sort out the return data.
|
|
707
|
-
var text1_a, text1_b, text2_a, text2_b;
|
|
393
|
+
let text1_a, text1_b, text2_a, text2_b;
|
|
708
394
|
if (text1.length > text2.length) {
|
|
709
395
|
text1_a = hm[0];
|
|
710
396
|
text1_b = hm[1];
|
|
@@ -716,114 +402,72 @@ diff_match_patch.prototype.diff_halfMatch_ = function(text1, text2) {
|
|
|
716
402
|
text1_a = hm[2];
|
|
717
403
|
text1_b = hm[3];
|
|
718
404
|
}
|
|
719
|
-
|
|
405
|
+
const mid_common = hm[4];
|
|
720
406
|
return [text1_a, text1_b, text2_a, text2_b, mid_common];
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
/** @type {?string} */
|
|
733
|
-
var lastequality = null;
|
|
734
|
-
// Always equal to diffs[equalities[equalitiesLength - 1]][1]
|
|
735
|
-
var pointer = 0; // Index of current position.
|
|
736
|
-
// Number of characters that changed prior to the equality.
|
|
737
|
-
var length_insertions1 = 0;
|
|
738
|
-
var length_deletions1 = 0;
|
|
739
|
-
// Number of characters that changed after the equality.
|
|
740
|
-
var length_insertions2 = 0;
|
|
741
|
-
var length_deletions2 = 0;
|
|
407
|
+
}
|
|
408
|
+
function diffCleanupSemantic(diffs) {
|
|
409
|
+
let changes = false;
|
|
410
|
+
const equalities = [];
|
|
411
|
+
let equalitiesLength = 0;
|
|
412
|
+
let lastEquality = null;
|
|
413
|
+
let pointer = 0;
|
|
414
|
+
let length_insertions1 = 0;
|
|
415
|
+
let length_deletions1 = 0;
|
|
416
|
+
let length_insertions2 = 0;
|
|
417
|
+
let length_deletions2 = 0;
|
|
742
418
|
while (pointer < diffs.length) {
|
|
743
|
-
if (diffs[pointer][0]
|
|
419
|
+
if (diffs[pointer][0] === DIFF_EQUAL) {
|
|
744
420
|
equalities[equalitiesLength++] = pointer;
|
|
745
421
|
length_insertions1 = length_insertions2;
|
|
746
422
|
length_deletions1 = length_deletions2;
|
|
747
423
|
length_insertions2 = 0;
|
|
748
424
|
length_deletions2 = 0;
|
|
749
|
-
|
|
750
|
-
} else {
|
|
751
|
-
if (diffs[pointer][0]
|
|
425
|
+
lastEquality = diffs[pointer][1];
|
|
426
|
+
} else {
|
|
427
|
+
if (diffs[pointer][0] === DIFF_INSERT)
|
|
752
428
|
length_insertions2 += diffs[pointer][1].length;
|
|
753
|
-
|
|
429
|
+
else
|
|
754
430
|
length_deletions2 += diffs[pointer][1].length;
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
// sides of it.
|
|
758
|
-
if (lastequality && (lastequality.length <=
|
|
759
|
-
Math.max(length_insertions1, length_deletions1)) &&
|
|
760
|
-
(lastequality.length <= Math.max(length_insertions2,
|
|
761
|
-
length_deletions2))) {
|
|
762
|
-
// Duplicate record.
|
|
763
|
-
diffs.splice(equalities[equalitiesLength - 1], 0,
|
|
764
|
-
[DIFF_DELETE, lastequality]);
|
|
765
|
-
// Change second copy to insert.
|
|
431
|
+
if (lastEquality && lastEquality.length <= Math.max(length_insertions1, length_deletions1) && lastEquality.length <= Math.max(length_insertions2, length_deletions2)) {
|
|
432
|
+
diffs.splice(equalities[equalitiesLength - 1], 0, createDiff(DIFF_DELETE, lastEquality));
|
|
766
433
|
diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;
|
|
767
|
-
// Throw away the equality we just deleted.
|
|
768
434
|
equalitiesLength--;
|
|
769
|
-
// Throw away the previous equality (it needs to be reevaluated).
|
|
770
435
|
equalitiesLength--;
|
|
771
436
|
pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;
|
|
772
|
-
length_insertions1 = 0;
|
|
437
|
+
length_insertions1 = 0;
|
|
773
438
|
length_deletions1 = 0;
|
|
774
439
|
length_insertions2 = 0;
|
|
775
440
|
length_deletions2 = 0;
|
|
776
|
-
|
|
441
|
+
lastEquality = null;
|
|
777
442
|
changes = true;
|
|
778
443
|
}
|
|
779
444
|
}
|
|
780
445
|
pointer++;
|
|
781
446
|
}
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
this.diff_cleanupMerge(diffs);
|
|
786
|
-
}
|
|
787
|
-
this.diff_cleanupSemanticLossless(diffs);
|
|
788
|
-
|
|
789
|
-
// Find any overlaps between deletions and insertions.
|
|
790
|
-
// e.g: <del>abcxxx</del><ins>xxxdef</ins>
|
|
791
|
-
// -> <del>abc</del>xxx<ins>def</ins>
|
|
792
|
-
// e.g: <del>xxxabc</del><ins>defxxx</ins>
|
|
793
|
-
// -> <ins>def</ins>xxx<del>abc</del>
|
|
794
|
-
// Only extract an overlap if it is as big as the edit ahead or behind it.
|
|
447
|
+
if (changes)
|
|
448
|
+
diffCleanupMerge(diffs);
|
|
449
|
+
diffCleanupSemanticLossless(diffs);
|
|
795
450
|
pointer = 1;
|
|
796
451
|
while (pointer < diffs.length) {
|
|
797
|
-
if (diffs[pointer - 1][0]
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
var overlap_length2 = this.diff_commonOverlap_(insertion, deletion);
|
|
452
|
+
if (diffs[pointer - 1][0] === DIFF_DELETE && diffs[pointer][0] === DIFF_INSERT) {
|
|
453
|
+
const deletion = diffs[pointer - 1][1];
|
|
454
|
+
const insertion = diffs[pointer][1];
|
|
455
|
+
const overlap_length1 = diffCommonOverlap(deletion, insertion);
|
|
456
|
+
const overlap_length2 = diffCommonOverlap(insertion, deletion);
|
|
803
457
|
if (overlap_length1 >= overlap_length2) {
|
|
804
|
-
if (overlap_length1 >= deletion.length / 2 ||
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
diffs.splice(pointer, 0,
|
|
808
|
-
[DIFF_EQUAL, insertion.substring(0, overlap_length1)]);
|
|
809
|
-
diffs[pointer - 1][1] =
|
|
810
|
-
deletion.substring(0, deletion.length - overlap_length1);
|
|
458
|
+
if (overlap_length1 >= deletion.length / 2 || overlap_length1 >= insertion.length / 2) {
|
|
459
|
+
diffs.splice(pointer, 0, createDiff(DIFF_EQUAL, insertion.substring(0, overlap_length1)));
|
|
460
|
+
diffs[pointer - 1][1] = deletion.substring(0, deletion.length - overlap_length1);
|
|
811
461
|
diffs[pointer + 1][1] = insertion.substring(overlap_length1);
|
|
812
462
|
pointer++;
|
|
813
463
|
}
|
|
814
464
|
} else {
|
|
815
|
-
if (overlap_length2 >= deletion.length / 2 ||
|
|
816
|
-
|
|
817
|
-
// Reverse overlap found.
|
|
818
|
-
// Insert an equality and swap and trim the surrounding edits.
|
|
819
|
-
diffs.splice(pointer, 0,
|
|
820
|
-
[DIFF_EQUAL, deletion.substring(0, overlap_length2)]);
|
|
465
|
+
if (overlap_length2 >= deletion.length / 2 || overlap_length2 >= insertion.length / 2) {
|
|
466
|
+
diffs.splice(pointer, 0, createDiff(DIFF_EQUAL, deletion.substring(0, overlap_length2)));
|
|
821
467
|
diffs[pointer - 1][0] = DIFF_INSERT;
|
|
822
|
-
diffs[pointer - 1][1] =
|
|
823
|
-
insertion.substring(0, insertion.length - overlap_length2);
|
|
468
|
+
diffs[pointer - 1][1] = insertion.substring(0, insertion.length - overlap_length2);
|
|
824
469
|
diffs[pointer + 1][0] = DIFF_DELETE;
|
|
825
|
-
diffs[pointer + 1][1] =
|
|
826
|
-
deletion.substring(overlap_length2);
|
|
470
|
+
diffs[pointer + 1][1] = deletion.substring(overlap_length2);
|
|
827
471
|
pointer++;
|
|
828
472
|
}
|
|
829
473
|
}
|
|
@@ -831,105 +475,62 @@ diff_match_patch.prototype.diff_cleanupSemantic = function(diffs) {
|
|
|
831
475
|
}
|
|
832
476
|
pointer++;
|
|
833
477
|
}
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
*/
|
|
843
|
-
diff_match_patch.prototype.diff_cleanupSemanticLossless = function(diffs) {
|
|
844
|
-
/**
|
|
845
|
-
* Given two strings, compute a score representing whether the internal
|
|
846
|
-
* boundary falls on logical boundaries.
|
|
847
|
-
* Scores range from 6 (best) to 0 (worst).
|
|
848
|
-
* Closure, but does not reference any external variables.
|
|
849
|
-
* @param {string} one First string.
|
|
850
|
-
* @param {string} two Second string.
|
|
851
|
-
* @return {number} The score.
|
|
852
|
-
* @private
|
|
853
|
-
*/
|
|
854
|
-
function diff_cleanupSemanticScore_(one, two) {
|
|
478
|
+
}
|
|
479
|
+
const nonAlphaNumericRegex_ = /[^a-z0-9]/i;
|
|
480
|
+
const whitespaceRegex_ = /\s/;
|
|
481
|
+
const linebreakRegex_ = /[\r\n]/;
|
|
482
|
+
const blanklineEndRegex_ = /\n\r?\n$/;
|
|
483
|
+
const blanklineStartRegex_ = /^\r?\n\r?\n/;
|
|
484
|
+
function diffCleanupSemanticLossless(diffs) {
|
|
485
|
+
function diffCleanupSemanticScore(one, two) {
|
|
855
486
|
if (!one || !two) {
|
|
856
|
-
// Edges are the best.
|
|
857
487
|
return 6;
|
|
858
488
|
}
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
var whitespace1 = nonAlphaNumeric1 &&
|
|
870
|
-
char1.match(diff_match_patch.whitespaceRegex_);
|
|
871
|
-
var whitespace2 = nonAlphaNumeric2 &&
|
|
872
|
-
char2.match(diff_match_patch.whitespaceRegex_);
|
|
873
|
-
var lineBreak1 = whitespace1 &&
|
|
874
|
-
char1.match(diff_match_patch.linebreakRegex_);
|
|
875
|
-
var lineBreak2 = whitespace2 &&
|
|
876
|
-
char2.match(diff_match_patch.linebreakRegex_);
|
|
877
|
-
var blankLine1 = lineBreak1 &&
|
|
878
|
-
one.match(diff_match_patch.blanklineEndRegex_);
|
|
879
|
-
var blankLine2 = lineBreak2 &&
|
|
880
|
-
two.match(diff_match_patch.blanklineStartRegex_);
|
|
881
|
-
|
|
489
|
+
const char1 = one.charAt(one.length - 1);
|
|
490
|
+
const char2 = two.charAt(0);
|
|
491
|
+
const nonAlphaNumeric1 = char1.match(nonAlphaNumericRegex_);
|
|
492
|
+
const nonAlphaNumeric2 = char2.match(nonAlphaNumericRegex_);
|
|
493
|
+
const whitespace1 = nonAlphaNumeric1 && char1.match(whitespaceRegex_);
|
|
494
|
+
const whitespace2 = nonAlphaNumeric2 && char2.match(whitespaceRegex_);
|
|
495
|
+
const lineBreak1 = whitespace1 && char1.match(linebreakRegex_);
|
|
496
|
+
const lineBreak2 = whitespace2 && char2.match(linebreakRegex_);
|
|
497
|
+
const blankLine1 = lineBreak1 && one.match(blanklineEndRegex_);
|
|
498
|
+
const blankLine2 = lineBreak2 && two.match(blanklineStartRegex_);
|
|
882
499
|
if (blankLine1 || blankLine2) {
|
|
883
|
-
// Five points for blank lines.
|
|
884
500
|
return 5;
|
|
885
501
|
} else if (lineBreak1 || lineBreak2) {
|
|
886
|
-
// Four points for line breaks.
|
|
887
502
|
return 4;
|
|
888
503
|
} else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {
|
|
889
|
-
// Three points for end of sentences.
|
|
890
504
|
return 3;
|
|
891
505
|
} else if (whitespace1 || whitespace2) {
|
|
892
|
-
// Two points for whitespace.
|
|
893
506
|
return 2;
|
|
894
507
|
} else if (nonAlphaNumeric1 || nonAlphaNumeric2) {
|
|
895
|
-
// One point for non-alphanumeric.
|
|
896
508
|
return 1;
|
|
897
509
|
}
|
|
898
510
|
return 0;
|
|
899
511
|
}
|
|
900
|
-
|
|
901
|
-
var pointer = 1;
|
|
902
|
-
// Intentionally ignore the first and last element (don't need checking).
|
|
512
|
+
let pointer = 1;
|
|
903
513
|
while (pointer < diffs.length - 1) {
|
|
904
|
-
if (diffs[pointer - 1][0]
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
var equality2 = diffs[pointer + 1][1];
|
|
910
|
-
|
|
911
|
-
// First, shift the edit as far left as possible.
|
|
912
|
-
var commonOffset = this.diff_commonSuffix(equality1, edit);
|
|
514
|
+
if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) {
|
|
515
|
+
let equality1 = diffs[pointer - 1][1];
|
|
516
|
+
let edit = diffs[pointer][1];
|
|
517
|
+
let equality2 = diffs[pointer + 1][1];
|
|
518
|
+
const commonOffset = diffCommonSuffix(equality1, edit);
|
|
913
519
|
if (commonOffset) {
|
|
914
|
-
|
|
520
|
+
const commonString = edit.substring(edit.length - commonOffset);
|
|
915
521
|
equality1 = equality1.substring(0, equality1.length - commonOffset);
|
|
916
522
|
edit = commonString + edit.substring(0, edit.length - commonOffset);
|
|
917
523
|
equality2 = commonString + equality2;
|
|
918
524
|
}
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
var bestEquality2 = equality2;
|
|
924
|
-
var bestScore = diff_cleanupSemanticScore_(equality1, edit) +
|
|
925
|
-
diff_cleanupSemanticScore_(edit, equality2);
|
|
525
|
+
let bestEquality1 = equality1;
|
|
526
|
+
let bestEdit = edit;
|
|
527
|
+
let bestEquality2 = equality2;
|
|
528
|
+
let bestScore = diffCleanupSemanticScore(equality1, edit) + diffCleanupSemanticScore(edit, equality2);
|
|
926
529
|
while (edit.charAt(0) === equality2.charAt(0)) {
|
|
927
530
|
equality1 += edit.charAt(0);
|
|
928
531
|
edit = edit.substring(1) + equality2.charAt(0);
|
|
929
532
|
equality2 = equality2.substring(1);
|
|
930
|
-
|
|
931
|
-
diff_cleanupSemanticScore_(edit, equality2);
|
|
932
|
-
// The >= encourages trailing rather than leading whitespace on edits.
|
|
533
|
+
const score = diffCleanupSemanticScore(equality1, edit) + diffCleanupSemanticScore(edit, equality2);
|
|
933
534
|
if (score >= bestScore) {
|
|
934
535
|
bestScore = score;
|
|
935
536
|
bestEquality1 = equality1;
|
|
@@ -937,9 +538,7 @@ diff_match_patch.prototype.diff_cleanupSemanticLossless = function(diffs) {
|
|
|
937
538
|
bestEquality2 = equality2;
|
|
938
539
|
}
|
|
939
540
|
}
|
|
940
|
-
|
|
941
|
-
if (diffs[pointer - 1][1] != bestEquality1) {
|
|
942
|
-
// We have an improvement, save it back to the diff.
|
|
541
|
+
if (diffs[pointer - 1][1] !== bestEquality1) {
|
|
943
542
|
if (bestEquality1) {
|
|
944
543
|
diffs[pointer - 1][1] = bestEquality1;
|
|
945
544
|
} else {
|
|
@@ -957,82 +556,51 @@ diff_match_patch.prototype.diff_cleanupSemanticLossless = function(diffs) {
|
|
|
957
556
|
}
|
|
958
557
|
pointer++;
|
|
959
558
|
}
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
var changes = false;
|
|
975
|
-
var equalities = []; // Stack of indices where equalities are found.
|
|
976
|
-
var equalitiesLength = 0; // Keeping our own length var is faster in JS.
|
|
977
|
-
/** @type {?string} */
|
|
978
|
-
var lastequality = null;
|
|
979
|
-
// Always equal to diffs[equalities[equalitiesLength - 1]][1]
|
|
980
|
-
var pointer = 0; // Index of current position.
|
|
981
|
-
// Is there an insertion operation before the last equality.
|
|
982
|
-
var pre_ins = false;
|
|
983
|
-
// Is there a deletion operation before the last equality.
|
|
984
|
-
var pre_del = false;
|
|
985
|
-
// Is there an insertion operation after the last equality.
|
|
986
|
-
var post_ins = false;
|
|
987
|
-
// Is there a deletion operation after the last equality.
|
|
988
|
-
var post_del = false;
|
|
559
|
+
}
|
|
560
|
+
function diffCleanupEfficiency(diffs, options = {}) {
|
|
561
|
+
const {
|
|
562
|
+
diffEditCost = defaultOptions.diffEditCost
|
|
563
|
+
} = options;
|
|
564
|
+
let changes = false;
|
|
565
|
+
const equalities = [];
|
|
566
|
+
let equalitiesLength = 0;
|
|
567
|
+
let lastEquality = null;
|
|
568
|
+
let pointer = 0;
|
|
569
|
+
let pre_ins = false;
|
|
570
|
+
let pre_del = false;
|
|
571
|
+
let post_ins = false;
|
|
572
|
+
let post_del = false;
|
|
989
573
|
while (pointer < diffs.length) {
|
|
990
|
-
if (diffs[pointer][0]
|
|
991
|
-
if (diffs[pointer][1].length <
|
|
992
|
-
(post_ins || post_del)) {
|
|
993
|
-
// Candidate found.
|
|
574
|
+
if (diffs[pointer][0] === DIFF_EQUAL) {
|
|
575
|
+
if (diffs[pointer][1].length < diffEditCost && (post_ins || post_del)) {
|
|
994
576
|
equalities[equalitiesLength++] = pointer;
|
|
995
577
|
pre_ins = post_ins;
|
|
996
578
|
pre_del = post_del;
|
|
997
|
-
|
|
579
|
+
lastEquality = diffs[pointer][1];
|
|
998
580
|
} else {
|
|
999
|
-
// Not a candidate, and can never become one.
|
|
1000
581
|
equalitiesLength = 0;
|
|
1001
|
-
|
|
582
|
+
lastEquality = null;
|
|
1002
583
|
}
|
|
1003
584
|
post_ins = post_del = false;
|
|
1004
|
-
} else {
|
|
1005
|
-
|
|
585
|
+
} else {
|
|
586
|
+
let booleanCount = function(...args) {
|
|
587
|
+
return args.filter(Boolean).length;
|
|
588
|
+
};
|
|
589
|
+
if (diffs[pointer][0] === DIFF_DELETE)
|
|
1006
590
|
post_del = true;
|
|
1007
|
-
|
|
591
|
+
else
|
|
1008
592
|
post_ins = true;
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
* Five types to be split:
|
|
1012
|
-
* <ins>A</ins><del>B</del>XY<ins>C</ins><del>D</del>
|
|
1013
|
-
* <ins>A</ins>X<ins>C</ins><del>D</del>
|
|
1014
|
-
* <ins>A</ins><del>B</del>X<ins>C</ins>
|
|
1015
|
-
* <ins>A</del>X<ins>C</ins><del>D</del>
|
|
1016
|
-
* <ins>A</ins><del>B</del>X<del>C</del>
|
|
1017
|
-
*/
|
|
1018
|
-
if (lastequality && ((pre_ins && pre_del && post_ins && post_del) ||
|
|
1019
|
-
((lastequality.length < this.Diff_EditCost / 2) &&
|
|
1020
|
-
(pre_ins + pre_del + post_ins + post_del) == 3))) {
|
|
1021
|
-
// Duplicate record.
|
|
1022
|
-
diffs.splice(equalities[equalitiesLength - 1], 0,
|
|
1023
|
-
[DIFF_DELETE, lastequality]);
|
|
1024
|
-
// Change second copy to insert.
|
|
593
|
+
if (lastEquality && (pre_ins && pre_del && post_ins && post_del || lastEquality.length < diffEditCost / 2 && booleanCount(pre_ins, pre_del, post_ins, post_del) === 3)) {
|
|
594
|
+
diffs.splice(equalities[equalitiesLength - 1], 0, createDiff(DIFF_DELETE, lastEquality));
|
|
1025
595
|
diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;
|
|
1026
|
-
equalitiesLength--;
|
|
1027
|
-
|
|
596
|
+
equalitiesLength--;
|
|
597
|
+
lastEquality = null;
|
|
1028
598
|
if (pre_ins && pre_del) {
|
|
1029
|
-
// No changes made which could affect previous entry, keep going.
|
|
1030
599
|
post_ins = post_del = true;
|
|
1031
600
|
equalitiesLength = 0;
|
|
1032
601
|
} else {
|
|
1033
|
-
equalitiesLength--;
|
|
1034
|
-
pointer = equalitiesLength > 0 ?
|
|
1035
|
-
equalities[equalitiesLength - 1] : -1;
|
|
602
|
+
equalitiesLength--;
|
|
603
|
+
pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;
|
|
1036
604
|
post_ins = post_del = false;
|
|
1037
605
|
}
|
|
1038
606
|
changes = true;
|
|
@@ -1040,26 +608,17 @@ diff_match_patch.prototype.diff_cleanupEfficiency = function(diffs) {
|
|
|
1040
608
|
}
|
|
1041
609
|
pointer++;
|
|
1042
610
|
}
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
*/
|
|
1055
|
-
diff_match_patch.prototype.diff_cleanupMerge = function(diffs) {
|
|
1056
|
-
diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.
|
|
1057
|
-
var pointer = 0;
|
|
1058
|
-
var count_delete = 0;
|
|
1059
|
-
var count_insert = 0;
|
|
1060
|
-
var text_delete = '';
|
|
1061
|
-
var text_insert = '';
|
|
1062
|
-
var commonlength;
|
|
611
|
+
if (changes)
|
|
612
|
+
diffCleanupMerge(diffs);
|
|
613
|
+
}
|
|
614
|
+
function diffCleanupMerge(diffs) {
|
|
615
|
+
diffs.push(createDiff(DIFF_EQUAL, ""));
|
|
616
|
+
let pointer = 0;
|
|
617
|
+
let count_delete = 0;
|
|
618
|
+
let count_insert = 0;
|
|
619
|
+
let text_delete = "";
|
|
620
|
+
let text_insert = "";
|
|
621
|
+
let commonlength;
|
|
1063
622
|
while (pointer < diffs.length) {
|
|
1064
623
|
switch (diffs[pointer][0]) {
|
|
1065
624
|
case DIFF_INSERT:
|
|
@@ -1073,52 +632,38 @@ diff_match_patch.prototype.diff_cleanupMerge = function(diffs) {
|
|
|
1073
632
|
pointer++;
|
|
1074
633
|
break;
|
|
1075
634
|
case DIFF_EQUAL:
|
|
1076
|
-
// Upon reaching an equality, check for prior redundancies.
|
|
1077
635
|
if (count_delete + count_insert > 1) {
|
|
1078
636
|
if (count_delete !== 0 && count_insert !== 0) {
|
|
1079
|
-
|
|
1080
|
-
commonlength = this.diff_commonPrefix(text_insert, text_delete);
|
|
637
|
+
commonlength = diffCommonPrefix(text_insert, text_delete);
|
|
1081
638
|
if (commonlength !== 0) {
|
|
1082
|
-
if (
|
|
1083
|
-
|
|
1084
|
-
DIFF_EQUAL) {
|
|
1085
|
-
diffs[pointer - count_delete - count_insert - 1][1] +=
|
|
1086
|
-
text_insert.substring(0, commonlength);
|
|
639
|
+
if (pointer - count_delete - count_insert > 0 && diffs[pointer - count_delete - count_insert - 1][0] === DIFF_EQUAL) {
|
|
640
|
+
diffs[pointer - count_delete - count_insert - 1][1] += text_insert.substring(0, commonlength);
|
|
1087
641
|
} else {
|
|
1088
|
-
diffs.splice(0, 0,
|
|
1089
|
-
text_insert.substring(0, commonlength)]);
|
|
642
|
+
diffs.splice(0, 0, createDiff(DIFF_EQUAL, text_insert.substring(0, commonlength)));
|
|
1090
643
|
pointer++;
|
|
1091
644
|
}
|
|
1092
645
|
text_insert = text_insert.substring(commonlength);
|
|
1093
646
|
text_delete = text_delete.substring(commonlength);
|
|
1094
647
|
}
|
|
1095
|
-
|
|
1096
|
-
commonlength = this.diff_commonSuffix(text_insert, text_delete);
|
|
648
|
+
commonlength = diffCommonSuffix(text_insert, text_delete);
|
|
1097
649
|
if (commonlength !== 0) {
|
|
1098
|
-
diffs[pointer][1] = text_insert.substring(text_insert.length -
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
commonlength);
|
|
1102
|
-
text_delete = text_delete.substring(0, text_delete.length -
|
|
1103
|
-
commonlength);
|
|
650
|
+
diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
|
|
651
|
+
text_insert = text_insert.substring(0, text_insert.length - commonlength);
|
|
652
|
+
text_delete = text_delete.substring(0, text_delete.length - commonlength);
|
|
1104
653
|
}
|
|
1105
654
|
}
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
diffs.splice(pointer - count_delete,
|
|
1112
|
-
count_delete + count_insert, [DIFF_DELETE, text_delete]);
|
|
1113
|
-
} else {
|
|
1114
|
-
diffs.splice(pointer - count_delete - count_insert,
|
|
1115
|
-
count_delete + count_insert, [DIFF_DELETE, text_delete],
|
|
1116
|
-
[DIFF_INSERT, text_insert]);
|
|
655
|
+
pointer -= count_delete + count_insert;
|
|
656
|
+
diffs.splice(pointer, count_delete + count_insert);
|
|
657
|
+
if (text_delete.length) {
|
|
658
|
+
diffs.splice(pointer, 0, createDiff(DIFF_DELETE, text_delete));
|
|
659
|
+
pointer++;
|
|
1117
660
|
}
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
661
|
+
if (text_insert.length) {
|
|
662
|
+
diffs.splice(pointer, 0, createDiff(DIFF_INSERT, text_insert));
|
|
663
|
+
pointer++;
|
|
664
|
+
}
|
|
665
|
+
pointer++;
|
|
666
|
+
} else if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {
|
|
1122
667
|
diffs[pointer - 1][1] += diffs[pointer][1];
|
|
1123
668
|
diffs.splice(pointer, 1);
|
|
1124
669
|
} else {
|
|
@@ -1126,167 +671,104 @@ diff_match_patch.prototype.diff_cleanupMerge = function(diffs) {
|
|
|
1126
671
|
}
|
|
1127
672
|
count_insert = 0;
|
|
1128
673
|
count_delete = 0;
|
|
1129
|
-
text_delete =
|
|
1130
|
-
text_insert =
|
|
674
|
+
text_delete = "";
|
|
675
|
+
text_insert = "";
|
|
1131
676
|
break;
|
|
1132
677
|
}
|
|
1133
678
|
}
|
|
1134
|
-
if (diffs[diffs.length - 1][1] ===
|
|
1135
|
-
diffs.pop();
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
// Second pass: look for single edits surrounded on both sides by equalities
|
|
1139
|
-
// which can be shifted sideways to eliminate an equality.
|
|
1140
|
-
// e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC
|
|
1141
|
-
var changes = false;
|
|
679
|
+
if (diffs[diffs.length - 1][1] === "")
|
|
680
|
+
diffs.pop();
|
|
681
|
+
let changes = false;
|
|
1142
682
|
pointer = 1;
|
|
1143
|
-
// Intentionally ignore the first and last element (don't need checking).
|
|
1144
683
|
while (pointer < diffs.length - 1) {
|
|
1145
|
-
if (diffs[pointer - 1][0]
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
if (diffs[pointer][1].substring(diffs[pointer][1].length -
|
|
1149
|
-
diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {
|
|
1150
|
-
// Shift the edit over the previous equality.
|
|
1151
|
-
diffs[pointer][1] = diffs[pointer - 1][1] +
|
|
1152
|
-
diffs[pointer][1].substring(0, diffs[pointer][1].length -
|
|
1153
|
-
diffs[pointer - 1][1].length);
|
|
684
|
+
if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) {
|
|
685
|
+
if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {
|
|
686
|
+
diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
|
|
1154
687
|
diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
|
|
1155
688
|
diffs.splice(pointer - 1, 1);
|
|
1156
689
|
changes = true;
|
|
1157
|
-
} else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length)
|
|
1158
|
-
diffs[pointer + 1][1]) {
|
|
1159
|
-
// Shift the edit over the next equality.
|
|
690
|
+
} else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) === diffs[pointer + 1][1]) {
|
|
1160
691
|
diffs[pointer - 1][1] += diffs[pointer + 1][1];
|
|
1161
|
-
diffs[pointer][1] =
|
|
1162
|
-
diffs[pointer][1].substring(diffs[pointer + 1][1].length) +
|
|
1163
|
-
diffs[pointer + 1][1];
|
|
692
|
+
diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
|
|
1164
693
|
diffs.splice(pointer + 1, 1);
|
|
1165
694
|
changes = true;
|
|
1166
695
|
}
|
|
1167
696
|
}
|
|
1168
697
|
pointer++;
|
|
1169
698
|
}
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
* text2.
|
|
1180
|
-
* e.g. 'The cat' vs 'The big cat', 1->1, 5->8
|
|
1181
|
-
* @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
|
|
1182
|
-
* @param {number} loc Location within text1.
|
|
1183
|
-
* @return {number} Location within text2.
|
|
1184
|
-
*/
|
|
1185
|
-
diff_match_patch.prototype.diff_xIndex = function(diffs, loc) {
|
|
1186
|
-
var chars1 = 0;
|
|
1187
|
-
var chars2 = 0;
|
|
1188
|
-
var last_chars1 = 0;
|
|
1189
|
-
var last_chars2 = 0;
|
|
1190
|
-
var x;
|
|
699
|
+
if (changes)
|
|
700
|
+
diffCleanupMerge(diffs);
|
|
701
|
+
}
|
|
702
|
+
function diffXIndex(diffs, loc) {
|
|
703
|
+
let chars1 = 0;
|
|
704
|
+
let chars2 = 0;
|
|
705
|
+
let last_chars1 = 0;
|
|
706
|
+
let last_chars2 = 0;
|
|
707
|
+
let x;
|
|
1191
708
|
for (x = 0; x < diffs.length; x++) {
|
|
1192
|
-
if (diffs[x][0] !== DIFF_INSERT) {
|
|
709
|
+
if (diffs[x][0] !== DIFF_INSERT) {
|
|
1193
710
|
chars1 += diffs[x][1].length;
|
|
1194
711
|
}
|
|
1195
|
-
if (diffs[x][0] !== DIFF_DELETE) {
|
|
712
|
+
if (diffs[x][0] !== DIFF_DELETE) {
|
|
1196
713
|
chars2 += diffs[x][1].length;
|
|
1197
714
|
}
|
|
1198
|
-
if (chars1 > loc) {
|
|
715
|
+
if (chars1 > loc) {
|
|
1199
716
|
break;
|
|
1200
717
|
}
|
|
1201
718
|
last_chars1 = chars1;
|
|
1202
719
|
last_chars2 = chars2;
|
|
1203
720
|
}
|
|
1204
|
-
|
|
1205
|
-
if (diffs.length != x && diffs[x][0] === DIFF_DELETE) {
|
|
721
|
+
if (diffs.length !== x && diffs[x][0] === DIFF_DELETE)
|
|
1206
722
|
return last_chars2;
|
|
1207
|
-
}
|
|
1208
|
-
// Add the remaining character length.
|
|
1209
723
|
return last_chars2 + (loc - last_chars1);
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
var pattern_lt = /</g;
|
|
1222
|
-
var pattern_gt = />/g;
|
|
1223
|
-
var pattern_para = /\n/g;
|
|
1224
|
-
for (var x = 0; x < diffs.length; x++) {
|
|
1225
|
-
var op = diffs[x][0]; // Operation (insert, delete, equal)
|
|
1226
|
-
var data = diffs[x][1]; // Text of change.
|
|
1227
|
-
var text = data.replace(pattern_amp, '&').replace(pattern_lt, '<')
|
|
1228
|
-
.replace(pattern_gt, '>').replace(pattern_para, '¶<br>');
|
|
724
|
+
}
|
|
725
|
+
function diffPrettyHtml(diffs) {
|
|
726
|
+
const html = [];
|
|
727
|
+
const pattern_amp = /&/g;
|
|
728
|
+
const pattern_lt = /</g;
|
|
729
|
+
const pattern_gt = />/g;
|
|
730
|
+
const pattern_para = /\n/g;
|
|
731
|
+
for (let x = 0; x < diffs.length; x++) {
|
|
732
|
+
const op = diffs[x][0];
|
|
733
|
+
const data = diffs[x][1];
|
|
734
|
+
const text = data.replace(pattern_amp, "&").replace(pattern_lt, "<").replace(pattern_gt, ">").replace(pattern_para, "¶<br>");
|
|
1229
735
|
switch (op) {
|
|
1230
736
|
case DIFF_INSERT:
|
|
1231
|
-
html[x] =
|
|
737
|
+
html[x] = `<ins style="background:#e6ffe6;">${text}</ins>`;
|
|
1232
738
|
break;
|
|
1233
739
|
case DIFF_DELETE:
|
|
1234
|
-
html[x] =
|
|
740
|
+
html[x] = `<del style="background:#ffe6e6;">${text}</del>`;
|
|
1235
741
|
break;
|
|
1236
742
|
case DIFF_EQUAL:
|
|
1237
|
-
html[x] =
|
|
743
|
+
html[x] = `<span>${text}</span>`;
|
|
1238
744
|
break;
|
|
1239
745
|
}
|
|
1240
746
|
}
|
|
1241
|
-
return html.join(
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
* @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
|
|
1248
|
-
* @return {string} Source text.
|
|
1249
|
-
*/
|
|
1250
|
-
diff_match_patch.prototype.diff_text1 = function(diffs) {
|
|
1251
|
-
var text = [];
|
|
1252
|
-
for (var x = 0; x < diffs.length; x++) {
|
|
1253
|
-
if (diffs[x][0] !== DIFF_INSERT) {
|
|
747
|
+
return html.join("");
|
|
748
|
+
}
|
|
749
|
+
function diffText1(diffs) {
|
|
750
|
+
const text = [];
|
|
751
|
+
for (let x = 0; x < diffs.length; x++) {
|
|
752
|
+
if (diffs[x][0] !== DIFF_INSERT)
|
|
1254
753
|
text[x] = diffs[x][1];
|
|
1255
|
-
}
|
|
1256
754
|
}
|
|
1257
|
-
return text.join(
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
* @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
|
|
1264
|
-
* @return {string} Destination text.
|
|
1265
|
-
*/
|
|
1266
|
-
diff_match_patch.prototype.diff_text2 = function(diffs) {
|
|
1267
|
-
var text = [];
|
|
1268
|
-
for (var x = 0; x < diffs.length; x++) {
|
|
1269
|
-
if (diffs[x][0] !== DIFF_DELETE) {
|
|
755
|
+
return text.join("");
|
|
756
|
+
}
|
|
757
|
+
function diffText2(diffs) {
|
|
758
|
+
const text = [];
|
|
759
|
+
for (let x = 0; x < diffs.length; x++) {
|
|
760
|
+
if (diffs[x][0] !== DIFF_DELETE)
|
|
1270
761
|
text[x] = diffs[x][1];
|
|
1271
|
-
}
|
|
1272
762
|
}
|
|
1273
|
-
return text.join(
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
*/
|
|
1283
|
-
diff_match_patch.prototype.diff_levenshtein = function(diffs) {
|
|
1284
|
-
var levenshtein = 0;
|
|
1285
|
-
var insertions = 0;
|
|
1286
|
-
var deletions = 0;
|
|
1287
|
-
for (var x = 0; x < diffs.length; x++) {
|
|
1288
|
-
var op = diffs[x][0];
|
|
1289
|
-
var data = diffs[x][1];
|
|
763
|
+
return text.join("");
|
|
764
|
+
}
|
|
765
|
+
function diffLevenshtein(diffs) {
|
|
766
|
+
let levenshtein = 0;
|
|
767
|
+
let insertions = 0;
|
|
768
|
+
let deletions = 0;
|
|
769
|
+
for (let x = 0; x < diffs.length; x++) {
|
|
770
|
+
const op = diffs[x][0];
|
|
771
|
+
const data = diffs[x][1];
|
|
1290
772
|
switch (op) {
|
|
1291
773
|
case DIFF_INSERT:
|
|
1292
774
|
insertions += data.length;
|
|
@@ -1295,7 +777,6 @@ diff_match_patch.prototype.diff_levenshtein = function(diffs) {
|
|
|
1295
777
|
deletions += data.length;
|
|
1296
778
|
break;
|
|
1297
779
|
case DIFF_EQUAL:
|
|
1298
|
-
// A deletion and an insertion is one substitution.
|
|
1299
780
|
levenshtein += Math.max(insertions, deletions);
|
|
1300
781
|
insertions = 0;
|
|
1301
782
|
deletions = 0;
|
|
@@ -1304,461 +785,285 @@ diff_match_patch.prototype.diff_levenshtein = function(diffs) {
|
|
|
1304
785
|
}
|
|
1305
786
|
levenshtein += Math.max(insertions, deletions);
|
|
1306
787
|
return levenshtein;
|
|
1307
|
-
}
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
* Crush the diff into an encoded string which describes the operations
|
|
1312
|
-
* required to transform text1 into text2.
|
|
1313
|
-
* E.g. =3\t-2\t+ing -> Keep 3 chars, delete 2 chars, insert 'ing'.
|
|
1314
|
-
* Operations are tab-separated. Inserted text is escaped using %xx notation.
|
|
1315
|
-
* @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
|
|
1316
|
-
* @return {string} Delta text.
|
|
1317
|
-
*/
|
|
1318
|
-
diff_match_patch.prototype.diff_toDelta = function(diffs) {
|
|
1319
|
-
var text = [];
|
|
1320
|
-
for (var x = 0; x < diffs.length; x++) {
|
|
788
|
+
}
|
|
789
|
+
function diffToDelta(diffs) {
|
|
790
|
+
const text = [];
|
|
791
|
+
for (let x = 0; x < diffs.length; x++) {
|
|
1321
792
|
switch (diffs[x][0]) {
|
|
1322
793
|
case DIFF_INSERT:
|
|
1323
|
-
text[x] =
|
|
794
|
+
text[x] = `+${encodeURI(diffs[x][1])}`;
|
|
1324
795
|
break;
|
|
1325
796
|
case DIFF_DELETE:
|
|
1326
|
-
text[x] =
|
|
797
|
+
text[x] = `-${diffs[x][1].length}`;
|
|
1327
798
|
break;
|
|
1328
799
|
case DIFF_EQUAL:
|
|
1329
|
-
text[x] =
|
|
800
|
+
text[x] = `=${diffs[x][1].length}`;
|
|
1330
801
|
break;
|
|
1331
802
|
}
|
|
1332
803
|
}
|
|
1333
|
-
return text.join(
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
* @return {!Array.<!diff_match_patch.Diff>} Array of diff tuples.
|
|
1343
|
-
* @throws {!Error} If invalid input.
|
|
1344
|
-
*/
|
|
1345
|
-
diff_match_patch.prototype.diff_fromDelta = function(text1, delta) {
|
|
1346
|
-
var diffs = [];
|
|
1347
|
-
var diffsLength = 0; // Keeping our own length var is faster in JS.
|
|
1348
|
-
var pointer = 0; // Cursor in text1
|
|
1349
|
-
var tokens = delta.split(/\t/g);
|
|
1350
|
-
for (var x = 0; x < tokens.length; x++) {
|
|
1351
|
-
// Each token begins with a one character parameter which specifies the
|
|
1352
|
-
// operation of this token (delete, insert, equality).
|
|
1353
|
-
var param = tokens[x].substring(1);
|
|
804
|
+
return text.join(" ").replace(/%20/g, " ");
|
|
805
|
+
}
|
|
806
|
+
function diffFromDelta(text1, delta) {
|
|
807
|
+
const diffs = [];
|
|
808
|
+
let diffsLength = 0;
|
|
809
|
+
let pointer = 0;
|
|
810
|
+
const tokens = delta.split(/\t/g);
|
|
811
|
+
for (let x = 0; x < tokens.length; x++) {
|
|
812
|
+
const param = tokens[x].substring(1);
|
|
1354
813
|
switch (tokens[x].charAt(0)) {
|
|
1355
|
-
case
|
|
814
|
+
case "+":
|
|
1356
815
|
try {
|
|
1357
|
-
diffs[diffsLength++] =
|
|
1358
|
-
} catch (
|
|
1359
|
-
|
|
1360
|
-
throw new Error('Illegal escape in diff_fromDelta: ' + param);
|
|
816
|
+
diffs[diffsLength++] = createDiff(DIFF_INSERT, decodeURI(param));
|
|
817
|
+
} catch (e) {
|
|
818
|
+
throw new Error(`Illegal escape in diff_fromDelta: ${param}`);
|
|
1361
819
|
}
|
|
1362
820
|
break;
|
|
1363
|
-
case
|
|
1364
|
-
|
|
1365
|
-
case
|
|
1366
|
-
|
|
1367
|
-
if (isNaN(n) || n < 0)
|
|
1368
|
-
throw new Error(
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
diffs[diffsLength++] = [DIFF_DELETE, text];
|
|
1375
|
-
}
|
|
821
|
+
case "-":
|
|
822
|
+
// Fall through.
|
|
823
|
+
case "=": {
|
|
824
|
+
const n = Number.parseInt(param, 10);
|
|
825
|
+
if (Number.isNaN(n) || n < 0)
|
|
826
|
+
throw new Error(`Invalid number in diff_fromDelta: ${param}`);
|
|
827
|
+
const text = text1.substring(pointer, pointer += n);
|
|
828
|
+
if (tokens[x].charAt(0) === "=")
|
|
829
|
+
diffs[diffsLength++] = createDiff(DIFF_EQUAL, text);
|
|
830
|
+
else
|
|
831
|
+
diffs[diffsLength++] = createDiff(DIFF_DELETE, text);
|
|
1376
832
|
break;
|
|
833
|
+
}
|
|
1377
834
|
default:
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
if (tokens[x]) {
|
|
1381
|
-
throw new Error('Invalid diff operation in diff_fromDelta: ' +
|
|
1382
|
-
tokens[x]);
|
|
1383
|
-
}
|
|
835
|
+
if (tokens[x])
|
|
836
|
+
throw new Error(`Invalid diff operation in diff_fromDelta: ${tokens[x]}`);
|
|
1384
837
|
}
|
|
1385
838
|
}
|
|
1386
|
-
if (pointer
|
|
1387
|
-
throw new Error(
|
|
1388
|
-
') does not equal source text length (' + text1.length + ').');
|
|
1389
|
-
}
|
|
839
|
+
if (pointer !== text1.length)
|
|
840
|
+
throw new Error(`Delta length (${pointer}) does not equal source text length (${text1.length}).`);
|
|
1390
841
|
return diffs;
|
|
1391
|
-
}
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
// MATCH FUNCTIONS
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
/**
|
|
1398
|
-
* Locate the best instance of 'pattern' in 'text' near 'loc'.
|
|
1399
|
-
* @param {string} text The text to search.
|
|
1400
|
-
* @param {string} pattern The pattern to search for.
|
|
1401
|
-
* @param {number} loc The location to search around.
|
|
1402
|
-
* @return {number} Best match index or -1.
|
|
1403
|
-
*/
|
|
1404
|
-
diff_match_patch.prototype.match_main = function(text, pattern, loc) {
|
|
1405
|
-
// Check for null inputs.
|
|
1406
|
-
if (text == null || pattern == null || loc == null) {
|
|
1407
|
-
throw new Error('Null input. (match_main)');
|
|
1408
|
-
}
|
|
842
|
+
}
|
|
1409
843
|
|
|
844
|
+
function matchMain(text, pattern, loc, options) {
|
|
845
|
+
if (text == null || pattern == null || loc == null)
|
|
846
|
+
throw new Error("Null input. (match_main)");
|
|
1410
847
|
loc = Math.max(0, Math.min(loc, text.length));
|
|
1411
|
-
if (text
|
|
1412
|
-
// Shortcut (potentially not guaranteed by the algorithm)
|
|
848
|
+
if (text === pattern) {
|
|
1413
849
|
return 0;
|
|
1414
850
|
} else if (!text.length) {
|
|
1415
|
-
// Nothing to match.
|
|
1416
851
|
return -1;
|
|
1417
|
-
} else if (text.substring(loc, loc + pattern.length)
|
|
1418
|
-
// Perfect match at the perfect spot! (Includes case of null pattern)
|
|
852
|
+
} else if (text.substring(loc, loc + pattern.length) === pattern) {
|
|
1419
853
|
return loc;
|
|
1420
854
|
} else {
|
|
1421
|
-
|
|
1422
|
-
return this.match_bitap_(text, pattern, loc);
|
|
1423
|
-
}
|
|
1424
|
-
};
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
/**
|
|
1428
|
-
* Locate the best instance of 'pattern' in 'text' near 'loc' using the
|
|
1429
|
-
* Bitap algorithm.
|
|
1430
|
-
* @param {string} text The text to search.
|
|
1431
|
-
* @param {string} pattern The pattern to search for.
|
|
1432
|
-
* @param {number} loc The location to search around.
|
|
1433
|
-
* @return {number} Best match index or -1.
|
|
1434
|
-
* @private
|
|
1435
|
-
*/
|
|
1436
|
-
diff_match_patch.prototype.match_bitap_ = function(text, pattern, loc) {
|
|
1437
|
-
if (pattern.length > this.Match_MaxBits) {
|
|
1438
|
-
throw new Error('Pattern too long for this browser.');
|
|
855
|
+
return matchBitap(text, pattern, loc, options);
|
|
1439
856
|
}
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
* @return {number} Overall score for match (0.0 = good, 1.0 = bad).
|
|
1452
|
-
* @private
|
|
1453
|
-
*/
|
|
1454
|
-
function match_bitapScore_(e, x) {
|
|
1455
|
-
var accuracy = e / pattern.length;
|
|
1456
|
-
var proximity = Math.abs(loc - x);
|
|
1457
|
-
if (!dmp.Match_Distance) {
|
|
1458
|
-
// Dodge divide by zero error.
|
|
1459
|
-
return proximity ? 1.0 : accuracy;
|
|
857
|
+
}
|
|
858
|
+
function matchBitap(text, pattern, loc, options) {
|
|
859
|
+
const resolved = resolveOptions(options);
|
|
860
|
+
if (pattern.length > resolved.matchMaxBits)
|
|
861
|
+
throw new Error("Pattern too long for this browser.");
|
|
862
|
+
const s = matchAlphabet(pattern);
|
|
863
|
+
function matchBitapScore(e, x) {
|
|
864
|
+
const accuracy = e / pattern.length;
|
|
865
|
+
const proximity = Math.abs(loc - x);
|
|
866
|
+
if (!resolved.matchDistance) {
|
|
867
|
+
return proximity ? 1 : accuracy;
|
|
1460
868
|
}
|
|
1461
|
-
return accuracy +
|
|
869
|
+
return accuracy + proximity / resolved.matchDistance;
|
|
1462
870
|
}
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
var best_loc = text.indexOf(pattern, loc);
|
|
1468
|
-
if (best_loc != -1) {
|
|
1469
|
-
score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold);
|
|
1470
|
-
// What about in the other direction? (speedup)
|
|
871
|
+
let score_threshold = resolved.matchThreshold;
|
|
872
|
+
let best_loc = text.indexOf(pattern, loc);
|
|
873
|
+
if (best_loc !== -1) {
|
|
874
|
+
score_threshold = Math.min(matchBitapScore(0, best_loc), score_threshold);
|
|
1471
875
|
best_loc = text.lastIndexOf(pattern, loc + pattern.length);
|
|
1472
|
-
if (best_loc
|
|
1473
|
-
score_threshold =
|
|
1474
|
-
Math.min(match_bitapScore_(0, best_loc), score_threshold);
|
|
1475
|
-
}
|
|
876
|
+
if (best_loc !== -1)
|
|
877
|
+
score_threshold = Math.min(matchBitapScore(0, best_loc), score_threshold);
|
|
1476
878
|
}
|
|
1477
|
-
|
|
1478
|
-
// Initialise the bit arrays.
|
|
1479
|
-
var matchmask = 1 << (pattern.length - 1);
|
|
879
|
+
const matchmask = 1 << pattern.length - 1;
|
|
1480
880
|
best_loc = -1;
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
for (var d = 0; d < pattern.length; d++) {
|
|
1486
|
-
// Scan for the best match; each iteration allows for one more error.
|
|
1487
|
-
// Run a binary search to determine how far from 'loc' we can stray at this
|
|
1488
|
-
// error level.
|
|
881
|
+
let bin_min, bin_mid;
|
|
882
|
+
let bin_max = pattern.length + text.length;
|
|
883
|
+
let last_rd = [];
|
|
884
|
+
for (let d = 0; d < pattern.length; d++) {
|
|
1489
885
|
bin_min = 0;
|
|
1490
886
|
bin_mid = bin_max;
|
|
1491
887
|
while (bin_min < bin_mid) {
|
|
1492
|
-
if (
|
|
888
|
+
if (matchBitapScore(d, loc + bin_mid) <= score_threshold)
|
|
1493
889
|
bin_min = bin_mid;
|
|
1494
|
-
|
|
890
|
+
else
|
|
1495
891
|
bin_max = bin_mid;
|
|
1496
|
-
}
|
|
1497
892
|
bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min);
|
|
1498
893
|
}
|
|
1499
|
-
// Use the result from this iteration as the maximum for the next.
|
|
1500
894
|
bin_max = bin_mid;
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
var rd = Array(finish + 2);
|
|
895
|
+
let start = Math.max(1, loc - bin_mid + 1);
|
|
896
|
+
const finish = Math.min(loc + bin_mid, text.length) + pattern.length;
|
|
897
|
+
const rd = new Array(finish + 2);
|
|
1505
898
|
rd[finish + 1] = (1 << d) - 1;
|
|
1506
|
-
for (
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
rd[j] = (
|
|
1512
|
-
} else { // Subsequent passes: fuzzy match.
|
|
1513
|
-
rd[j] = (((rd[j + 1] << 1) | 1) & charMatch) |
|
|
1514
|
-
(((last_rd[j + 1] | last_rd[j]) << 1) | 1) |
|
|
1515
|
-
last_rd[j + 1];
|
|
899
|
+
for (let j = finish; j >= start; j--) {
|
|
900
|
+
const charMatch = s[text.charAt(j - 1)];
|
|
901
|
+
if (d === 0) {
|
|
902
|
+
rd[j] = (rd[j + 1] << 1 | 1) & charMatch;
|
|
903
|
+
} else {
|
|
904
|
+
rd[j] = (rd[j + 1] << 1 | 1) & charMatch | ((last_rd[j + 1] | last_rd[j]) << 1 | 1) | last_rd[j + 1];
|
|
1516
905
|
}
|
|
1517
906
|
if (rd[j] & matchmask) {
|
|
1518
|
-
|
|
1519
|
-
// This match will almost certainly be better than any existing match.
|
|
1520
|
-
// But check anyway.
|
|
907
|
+
const score = matchBitapScore(d, j - 1);
|
|
1521
908
|
if (score <= score_threshold) {
|
|
1522
|
-
// Told you so.
|
|
1523
909
|
score_threshold = score;
|
|
1524
910
|
best_loc = j - 1;
|
|
1525
911
|
if (best_loc > loc) {
|
|
1526
|
-
// When passing loc, don't exceed our current distance from loc.
|
|
1527
912
|
start = Math.max(1, 2 * loc - best_loc);
|
|
1528
913
|
} else {
|
|
1529
|
-
// Already passed loc, downhill from here on in.
|
|
1530
914
|
break;
|
|
1531
915
|
}
|
|
1532
916
|
}
|
|
1533
917
|
}
|
|
1534
918
|
}
|
|
1535
|
-
|
|
1536
|
-
if (match_bitapScore_(d + 1, loc) > score_threshold) {
|
|
919
|
+
if (matchBitapScore(d + 1, loc) > score_threshold)
|
|
1537
920
|
break;
|
|
1538
|
-
}
|
|
1539
921
|
last_rd = rd;
|
|
1540
922
|
}
|
|
1541
923
|
return best_loc;
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
* Initialise the alphabet for the Bitap algorithm.
|
|
1547
|
-
* @param {string} pattern The text to encode.
|
|
1548
|
-
* @return {!Object} Hash of character locations.
|
|
1549
|
-
* @private
|
|
1550
|
-
*/
|
|
1551
|
-
diff_match_patch.prototype.match_alphabet_ = function(pattern) {
|
|
1552
|
-
var s = {};
|
|
1553
|
-
for (var i = 0; i < pattern.length; i++) {
|
|
924
|
+
}
|
|
925
|
+
function matchAlphabet(pattern) {
|
|
926
|
+
const s = {};
|
|
927
|
+
for (let i = 0; i < pattern.length; i++)
|
|
1554
928
|
s[pattern.charAt(i)] = 0;
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
s[pattern.charAt(i)] |= 1 << (pattern.length - i - 1);
|
|
1558
|
-
}
|
|
929
|
+
for (let i = 0; i < pattern.length; i++)
|
|
930
|
+
s[pattern.charAt(i)] |= 1 << pattern.length - i - 1;
|
|
1559
931
|
return s;
|
|
1560
|
-
}
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
// PATCH FUNCTIONS
|
|
1564
|
-
|
|
932
|
+
}
|
|
1565
933
|
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
934
|
+
var __defProp = Object.defineProperty;
|
|
935
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
936
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
937
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
938
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
939
|
+
var __spreadValues = (a, b) => {
|
|
940
|
+
for (var prop in b || (b = {}))
|
|
941
|
+
if (__hasOwnProp.call(b, prop))
|
|
942
|
+
__defNormalProp(a, prop, b[prop]);
|
|
943
|
+
if (__getOwnPropSymbols)
|
|
944
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
945
|
+
if (__propIsEnum.call(b, prop))
|
|
946
|
+
__defNormalProp(a, prop, b[prop]);
|
|
947
|
+
}
|
|
948
|
+
return a;
|
|
949
|
+
};
|
|
950
|
+
function patchAddContext(patch, text, options) {
|
|
951
|
+
if (text.length === 0)
|
|
1575
952
|
return;
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
padding +=
|
|
1586
|
-
pattern = text.substring(patch.start2 - padding,
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
patch.diffs.unshift([DIFF_EQUAL, prefix]);
|
|
1596
|
-
}
|
|
1597
|
-
// Add the suffix.
|
|
1598
|
-
var suffix = text.substring(patch.start2 + patch.length1,
|
|
1599
|
-
patch.start2 + patch.length1 + padding);
|
|
1600
|
-
if (suffix) {
|
|
1601
|
-
patch.diffs.push([DIFF_EQUAL, suffix]);
|
|
1602
|
-
}
|
|
1603
|
-
|
|
1604
|
-
// Roll back the start points.
|
|
953
|
+
if (patch.start2 === null)
|
|
954
|
+
throw new Error("patch not initialized");
|
|
955
|
+
const {
|
|
956
|
+
matchMaxBits = defaultOptions.matchMaxBits,
|
|
957
|
+
patchMargin = defaultOptions.patchMargin
|
|
958
|
+
} = options;
|
|
959
|
+
let pattern = text.substring(patch.start2, patch.start2 + patch.length1);
|
|
960
|
+
let padding = 0;
|
|
961
|
+
while (text.indexOf(pattern) !== text.lastIndexOf(pattern) && pattern.length < matchMaxBits - patchMargin - patchMargin) {
|
|
962
|
+
padding += patchMargin;
|
|
963
|
+
pattern = text.substring(patch.start2 - padding, patch.start2 + patch.length1 + padding);
|
|
964
|
+
}
|
|
965
|
+
padding += patchMargin;
|
|
966
|
+
const prefix = text.substring(patch.start2 - padding, patch.start2);
|
|
967
|
+
if (prefix)
|
|
968
|
+
patch.diffs.unshift(createDiff(DIFF_EQUAL, prefix));
|
|
969
|
+
const suffix = text.substring(patch.start2 + patch.length1, patch.start2 + patch.length1 + padding);
|
|
970
|
+
if (suffix)
|
|
971
|
+
patch.diffs.push(createDiff(DIFF_EQUAL, suffix));
|
|
1605
972
|
patch.start1 -= prefix.length;
|
|
1606
973
|
patch.start2 -= prefix.length;
|
|
1607
|
-
// Extend the lengths.
|
|
1608
974
|
patch.length1 += prefix.length + suffix.length;
|
|
1609
975
|
patch.length2 += prefix.length + suffix.length;
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
* available to the caller:
|
|
1618
|
-
* Method 1:
|
|
1619
|
-
* a = text1, b = text2
|
|
1620
|
-
* Method 2:
|
|
1621
|
-
* a = diffs
|
|
1622
|
-
* Method 3 (optimal):
|
|
1623
|
-
* a = text1, b = diffs
|
|
1624
|
-
* Method 4 (deprecated, use method 3):
|
|
1625
|
-
* a = text1, b = text2, c = diffs
|
|
1626
|
-
*
|
|
1627
|
-
* @param {string|!Array.<!diff_match_patch.Diff>} a text1 (methods 1,3,4) or
|
|
1628
|
-
* Array of diff tuples for text1 to text2 (method 2).
|
|
1629
|
-
* @param {string|!Array.<!diff_match_patch.Diff>} opt_b text2 (methods 1,4) or
|
|
1630
|
-
* Array of diff tuples for text1 to text2 (method 3) or undefined (method 2).
|
|
1631
|
-
* @param {string|!Array.<!diff_match_patch.Diff>} opt_c Array of diff tuples
|
|
1632
|
-
* for text1 to text2 (method 4) or undefined (methods 1,2,3).
|
|
1633
|
-
* @return {!Array.<!diff_match_patch.patch_obj>} Array of Patch objects.
|
|
1634
|
-
*/
|
|
1635
|
-
diff_match_patch.prototype.patch_make = function(a, opt_b, opt_c) {
|
|
1636
|
-
var text1, diffs;
|
|
1637
|
-
if (typeof a == 'string' && typeof opt_b == 'string' &&
|
|
1638
|
-
typeof opt_c == 'undefined') {
|
|
1639
|
-
// Method 1: text1, text2
|
|
1640
|
-
// Compute diffs from text1 and text2.
|
|
1641
|
-
text1 = /** @type {string} */(a);
|
|
1642
|
-
diffs = this.diff_main(text1, /** @type {string} */(opt_b), true);
|
|
976
|
+
}
|
|
977
|
+
function patchMake(a, opt_b, opt_c, options = {}) {
|
|
978
|
+
const resolved = __spreadValues(__spreadValues({}, defaultOptions), options);
|
|
979
|
+
let text1, diffs;
|
|
980
|
+
if (typeof a == "string" && typeof opt_b == "string" && typeof opt_c == "undefined") {
|
|
981
|
+
text1 = a;
|
|
982
|
+
diffs = diffMain(text1, opt_b, resolved, true);
|
|
1643
983
|
if (diffs.length > 2) {
|
|
1644
|
-
|
|
1645
|
-
|
|
984
|
+
diffCleanupSemantic(diffs);
|
|
985
|
+
diffCleanupEfficiency(diffs);
|
|
1646
986
|
}
|
|
1647
|
-
} else if (a && typeof a ==
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
text1 =
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
// text2 is not used.
|
|
1662
|
-
text1 = /** @type {string} */(a);
|
|
1663
|
-
diffs = /** @type {!Array.<!diff_match_patch.Diff>} */(opt_c);
|
|
987
|
+
} else if (a && typeof a == "object" && typeof opt_b == "undefined" && typeof opt_c == "undefined") {
|
|
988
|
+
diffs = /** @type {Diff[]} */
|
|
989
|
+
a;
|
|
990
|
+
text1 = diffText1(diffs);
|
|
991
|
+
} else if (typeof a == "string" && opt_b && typeof opt_b == "object" && typeof opt_c == "undefined") {
|
|
992
|
+
text1 = /** @type {string} */
|
|
993
|
+
a;
|
|
994
|
+
diffs = /** @type {Diff[]} */
|
|
995
|
+
opt_b;
|
|
996
|
+
} else if (typeof a == "string" && typeof opt_b == "string" && opt_c && typeof opt_c == "object") {
|
|
997
|
+
text1 = /** @type {string} */
|
|
998
|
+
a;
|
|
999
|
+
diffs = /** @type {Diff[]} */
|
|
1000
|
+
opt_c;
|
|
1664
1001
|
} else {
|
|
1665
|
-
throw new Error(
|
|
1666
|
-
}
|
|
1667
|
-
|
|
1668
|
-
if (diffs.length === 0) {
|
|
1669
|
-
return []; // Get rid of the null case.
|
|
1002
|
+
throw new Error("Unknown call format to patch_make.");
|
|
1670
1003
|
}
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
var diff_text = diffs[x][1];
|
|
1684
|
-
|
|
1004
|
+
if (diffs.length === 0)
|
|
1005
|
+
return [];
|
|
1006
|
+
const patches = [];
|
|
1007
|
+
let patch = createPatch();
|
|
1008
|
+
let patchDiffLength = 0;
|
|
1009
|
+
let char_count1 = 0;
|
|
1010
|
+
let char_count2 = 0;
|
|
1011
|
+
let prepatch_text = text1;
|
|
1012
|
+
let postpatch_text = text1;
|
|
1013
|
+
for (let x = 0; x < diffs.length; x++) {
|
|
1014
|
+
const diff_type = diffs[x][0];
|
|
1015
|
+
const diff_text = diffs[x][1];
|
|
1685
1016
|
if (!patchDiffLength && diff_type !== DIFF_EQUAL) {
|
|
1686
|
-
// A new patch starts here.
|
|
1687
1017
|
patch.start1 = char_count1;
|
|
1688
1018
|
patch.start2 = char_count2;
|
|
1689
1019
|
}
|
|
1690
|
-
|
|
1691
1020
|
switch (diff_type) {
|
|
1692
1021
|
case DIFF_INSERT:
|
|
1693
1022
|
patch.diffs[patchDiffLength++] = diffs[x];
|
|
1694
1023
|
patch.length2 += diff_text.length;
|
|
1695
|
-
postpatch_text = postpatch_text.substring(0, char_count2) + diff_text +
|
|
1696
|
-
postpatch_text.substring(char_count2);
|
|
1024
|
+
postpatch_text = postpatch_text.substring(0, char_count2) + diff_text + postpatch_text.substring(char_count2);
|
|
1697
1025
|
break;
|
|
1698
1026
|
case DIFF_DELETE:
|
|
1699
1027
|
patch.length1 += diff_text.length;
|
|
1700
1028
|
patch.diffs[patchDiffLength++] = diffs[x];
|
|
1701
|
-
postpatch_text = postpatch_text.substring(0, char_count2) +
|
|
1702
|
-
postpatch_text.substring(char_count2 +
|
|
1703
|
-
diff_text.length);
|
|
1029
|
+
postpatch_text = postpatch_text.substring(0, char_count2) + postpatch_text.substring(char_count2 + diff_text.length);
|
|
1704
1030
|
break;
|
|
1705
1031
|
case DIFF_EQUAL:
|
|
1706
|
-
if (diff_text.length <= 2 *
|
|
1707
|
-
patchDiffLength && diffs.length != x + 1) {
|
|
1708
|
-
// Small equality inside a patch.
|
|
1032
|
+
if (diff_text.length <= 2 * resolved.patchMargin && patchDiffLength && diffs.length !== x + 1) {
|
|
1709
1033
|
patch.diffs[patchDiffLength++] = diffs[x];
|
|
1710
1034
|
patch.length1 += diff_text.length;
|
|
1711
1035
|
patch.length2 += diff_text.length;
|
|
1712
|
-
} else if (diff_text.length >= 2 *
|
|
1713
|
-
// Time for a new patch.
|
|
1036
|
+
} else if (diff_text.length >= 2 * resolved.patchMargin) {
|
|
1714
1037
|
if (patchDiffLength) {
|
|
1715
|
-
|
|
1038
|
+
patchAddContext(patch, prepatch_text, resolved);
|
|
1716
1039
|
patches.push(patch);
|
|
1717
|
-
patch =
|
|
1040
|
+
patch = createPatch();
|
|
1718
1041
|
patchDiffLength = 0;
|
|
1719
|
-
// Unlike Unidiff, our patch lists have a rolling context.
|
|
1720
|
-
// http://code.google.com/p/google-diff-match-patch/wiki/Unidiff
|
|
1721
|
-
// Update prepatch text & pos to reflect the application of the
|
|
1722
|
-
// just completed patch.
|
|
1723
1042
|
prepatch_text = postpatch_text;
|
|
1724
1043
|
char_count1 = char_count2;
|
|
1725
1044
|
}
|
|
1726
1045
|
}
|
|
1727
1046
|
break;
|
|
1728
1047
|
}
|
|
1729
|
-
|
|
1730
|
-
// Update the current character count.
|
|
1731
|
-
if (diff_type !== DIFF_INSERT) {
|
|
1048
|
+
if (diff_type !== DIFF_INSERT)
|
|
1732
1049
|
char_count1 += diff_text.length;
|
|
1733
|
-
|
|
1734
|
-
if (diff_type !== DIFF_DELETE) {
|
|
1050
|
+
if (diff_type !== DIFF_DELETE)
|
|
1735
1051
|
char_count2 += diff_text.length;
|
|
1736
|
-
}
|
|
1737
1052
|
}
|
|
1738
|
-
// Pick up the leftover patch if not empty.
|
|
1739
1053
|
if (patchDiffLength) {
|
|
1740
|
-
|
|
1054
|
+
patchAddContext(patch, prepatch_text, resolved);
|
|
1741
1055
|
patches.push(patch);
|
|
1742
1056
|
}
|
|
1743
|
-
|
|
1744
1057
|
return patches;
|
|
1745
|
-
}
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
* @return {!Array.<!diff_match_patch.patch_obj>} Array of Patch objects.
|
|
1752
|
-
*/
|
|
1753
|
-
diff_match_patch.prototype.patch_deepCopy = function(patches) {
|
|
1754
|
-
// Making deep copies is hard in JavaScript.
|
|
1755
|
-
var patchesCopy = [];
|
|
1756
|
-
for (var x = 0; x < patches.length; x++) {
|
|
1757
|
-
var patch = patches[x];
|
|
1758
|
-
var patchCopy = new diff_match_patch.patch_obj();
|
|
1058
|
+
}
|
|
1059
|
+
function patchDeepCopy(patches) {
|
|
1060
|
+
const patchesCopy = [];
|
|
1061
|
+
for (let x = 0; x < patches.length; x++) {
|
|
1062
|
+
const patch = patches[x];
|
|
1063
|
+
const patchCopy = createPatch();
|
|
1759
1064
|
patchCopy.diffs = [];
|
|
1760
|
-
for (
|
|
1761
|
-
patchCopy.diffs[y] = patch.diffs[y].
|
|
1065
|
+
for (let y = 0; y < patch.diffs.length; y++) {
|
|
1066
|
+
patchCopy.diffs[y] = createDiff(patch.diffs[y][0], patch.diffs[y][1]);
|
|
1762
1067
|
}
|
|
1763
1068
|
patchCopy.start1 = patch.start1;
|
|
1764
1069
|
patchCopy.start2 = patch.start2;
|
|
@@ -1767,227 +1072,159 @@ diff_match_patch.prototype.patch_deepCopy = function(patches) {
|
|
|
1767
1072
|
patchesCopy[x] = patchCopy;
|
|
1768
1073
|
}
|
|
1769
1074
|
return patchesCopy;
|
|
1770
|
-
}
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
/**
|
|
1774
|
-
* Merge a set of patches onto the text. Return a patched text, as well
|
|
1775
|
-
* as a list of true/false values indicating which patches were applied.
|
|
1776
|
-
* @param {!Array.<!diff_match_patch.patch_obj>} patches Array of Patch objects.
|
|
1777
|
-
* @param {string} text Old text.
|
|
1778
|
-
* @return {!Array.<string|!Array.<boolean>>} Two element Array, containing the
|
|
1779
|
-
* new text and an array of boolean values.
|
|
1780
|
-
*/
|
|
1781
|
-
diff_match_patch.prototype.patch_apply = function(patches, text) {
|
|
1782
|
-
if (patches.length == 0) {
|
|
1075
|
+
}
|
|
1076
|
+
function patchApply(patches, text, options) {
|
|
1077
|
+
if (patches.length === 0)
|
|
1783
1078
|
return [text, []];
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
patches = this.patch_deepCopy(patches);
|
|
1788
|
-
|
|
1789
|
-
var nullPadding = this.patch_addPadding(patches);
|
|
1079
|
+
patches = patchDeepCopy(patches);
|
|
1080
|
+
const resolved = resolveOptions(options);
|
|
1081
|
+
const nullPadding = patchAddPadding(patches, resolved);
|
|
1790
1082
|
text = nullPadding + text + nullPadding;
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
if (end_loc
|
|
1814
|
-
// Can't find valid trailing context. Drop this patch.
|
|
1083
|
+
patchSplitMax(patches, resolved);
|
|
1084
|
+
let delta = 0;
|
|
1085
|
+
const results = [];
|
|
1086
|
+
for (let x = 0; x < patches.length; x++) {
|
|
1087
|
+
const expected_loc = patches[x].start2 + delta;
|
|
1088
|
+
const text1 = diffText1(patches[x].diffs);
|
|
1089
|
+
let start_loc;
|
|
1090
|
+
let end_loc = -1;
|
|
1091
|
+
if (text1.length > resolved.matchMaxBits) {
|
|
1092
|
+
start_loc = matchMain(
|
|
1093
|
+
text,
|
|
1094
|
+
text1.substring(0, resolved.matchMaxBits),
|
|
1095
|
+
expected_loc,
|
|
1096
|
+
options
|
|
1097
|
+
);
|
|
1098
|
+
if (start_loc !== -1) {
|
|
1099
|
+
end_loc = matchMain(
|
|
1100
|
+
text,
|
|
1101
|
+
text1.substring(text1.length - resolved.matchMaxBits),
|
|
1102
|
+
expected_loc + text1.length - resolved.matchMaxBits,
|
|
1103
|
+
options
|
|
1104
|
+
);
|
|
1105
|
+
if (end_loc === -1 || start_loc >= end_loc) {
|
|
1815
1106
|
start_loc = -1;
|
|
1816
1107
|
}
|
|
1817
1108
|
}
|
|
1818
1109
|
} else {
|
|
1819
|
-
start_loc =
|
|
1110
|
+
start_loc = matchMain(text, text1, expected_loc, options);
|
|
1820
1111
|
}
|
|
1821
|
-
if (start_loc
|
|
1822
|
-
// No match found. :(
|
|
1112
|
+
if (start_loc === -1) {
|
|
1823
1113
|
results[x] = false;
|
|
1824
|
-
// Subtract the delta for this failed patch from subsequent patches.
|
|
1825
1114
|
delta -= patches[x].length2 - patches[x].length1;
|
|
1826
1115
|
} else {
|
|
1827
|
-
// Found a match. :)
|
|
1828
1116
|
results[x] = true;
|
|
1829
1117
|
delta = start_loc - expected_loc;
|
|
1830
|
-
|
|
1831
|
-
if (end_loc
|
|
1118
|
+
let text2;
|
|
1119
|
+
if (end_loc === -1)
|
|
1832
1120
|
text2 = text.substring(start_loc, start_loc + text1.length);
|
|
1121
|
+
else
|
|
1122
|
+
text2 = text.substring(start_loc, end_loc + resolved.matchMaxBits);
|
|
1123
|
+
if (text1 === text2) {
|
|
1124
|
+
text = text.substring(0, start_loc) + diffText2(patches[x].diffs) + text.substring(start_loc + text1.length);
|
|
1833
1125
|
} else {
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
if (text1 == text2) {
|
|
1837
|
-
// Perfect match, just shove the replacement text in.
|
|
1838
|
-
text = text.substring(0, start_loc) +
|
|
1839
|
-
this.diff_text2(patches[x].diffs) +
|
|
1840
|
-
text.substring(start_loc + text1.length);
|
|
1841
|
-
} else {
|
|
1842
|
-
// Imperfect match. Run a diff to get a framework of equivalent
|
|
1843
|
-
// indices.
|
|
1844
|
-
var diffs = this.diff_main(text1, text2, false);
|
|
1845
|
-
if (text1.length > this.Match_MaxBits &&
|
|
1846
|
-
this.diff_levenshtein(diffs) / text1.length >
|
|
1847
|
-
this.Patch_DeleteThreshold) {
|
|
1848
|
-
// The end points match, but the content is unacceptably bad.
|
|
1126
|
+
const diffs = diffMain(text1, text2, options, false);
|
|
1127
|
+
if (text1.length > resolved.matchMaxBits && diffLevenshtein(diffs) / text1.length > resolved.patchDeleteThreshold) {
|
|
1849
1128
|
results[x] = false;
|
|
1850
1129
|
} else {
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
for (
|
|
1855
|
-
|
|
1856
|
-
if (mod[0] !== DIFF_EQUAL)
|
|
1857
|
-
index2 =
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
} else if (mod[0] === DIFF_DELETE) { // Deletion
|
|
1863
|
-
text = text.substring(0, start_loc + index2) +
|
|
1864
|
-
text.substring(start_loc + this.diff_xIndex(diffs,
|
|
1865
|
-
index1 + mod[1].length));
|
|
1130
|
+
diffCleanupSemanticLossless(diffs);
|
|
1131
|
+
let index1 = 0;
|
|
1132
|
+
let index2 = 0;
|
|
1133
|
+
for (let y = 0; y < patches[x].diffs.length; y++) {
|
|
1134
|
+
const mod = patches[x].diffs[y];
|
|
1135
|
+
if (mod[0] !== DIFF_EQUAL)
|
|
1136
|
+
index2 = diffXIndex(diffs, index1);
|
|
1137
|
+
if (mod[0] === DIFF_INSERT) {
|
|
1138
|
+
text = text.substring(0, start_loc + index2) + mod[1] + text.substring(start_loc + index2);
|
|
1139
|
+
} else if (mod[0] === DIFF_DELETE) {
|
|
1140
|
+
text = text.substring(0, start_loc + index2) + text.substring(start_loc + diffXIndex(diffs, index1 + mod[1].length));
|
|
1866
1141
|
}
|
|
1867
|
-
if (mod[0] !== DIFF_DELETE)
|
|
1142
|
+
if (mod[0] !== DIFF_DELETE)
|
|
1868
1143
|
index1 += mod[1].length;
|
|
1869
|
-
}
|
|
1870
1144
|
}
|
|
1871
1145
|
}
|
|
1872
1146
|
}
|
|
1873
1147
|
}
|
|
1874
1148
|
}
|
|
1875
|
-
// Strip the padding off.
|
|
1876
1149
|
text = text.substring(nullPadding.length, text.length - nullPadding.length);
|
|
1877
1150
|
return [text, results];
|
|
1878
|
-
}
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
* @return {string} The padding string added to each side.
|
|
1886
|
-
*/
|
|
1887
|
-
diff_match_patch.prototype.patch_addPadding = function(patches) {
|
|
1888
|
-
var paddingLength = this.Patch_Margin;
|
|
1889
|
-
var nullPadding = '';
|
|
1890
|
-
for (var x = 1; x <= paddingLength; x++) {
|
|
1151
|
+
}
|
|
1152
|
+
function patchAddPadding(patches, options = {}) {
|
|
1153
|
+
const {
|
|
1154
|
+
patchMargin: paddingLength = defaultOptions.patchMargin
|
|
1155
|
+
} = options;
|
|
1156
|
+
let nullPadding = "";
|
|
1157
|
+
for (let x = 1; x <= paddingLength; x++)
|
|
1891
1158
|
nullPadding += String.fromCharCode(x);
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
// Bump all the patches forward.
|
|
1895
|
-
for (var x = 0; x < patches.length; x++) {
|
|
1159
|
+
for (let x = 0; x < patches.length; x++) {
|
|
1896
1160
|
patches[x].start1 += paddingLength;
|
|
1897
1161
|
patches[x].start2 += paddingLength;
|
|
1898
1162
|
}
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
diffs.unshift([DIFF_EQUAL, nullPadding]);
|
|
1906
|
-
patch.start1 -= paddingLength; // Should be 0.
|
|
1907
|
-
patch.start2 -= paddingLength; // Should be 0.
|
|
1163
|
+
let patch = patches[0];
|
|
1164
|
+
let diffs = patch.diffs;
|
|
1165
|
+
if (diffs.length === 0 || diffs[0][0] !== DIFF_EQUAL) {
|
|
1166
|
+
diffs.unshift(createDiff(DIFF_EQUAL, nullPadding));
|
|
1167
|
+
patch.start1 -= paddingLength;
|
|
1168
|
+
patch.start2 -= paddingLength;
|
|
1908
1169
|
patch.length1 += paddingLength;
|
|
1909
1170
|
patch.length2 += paddingLength;
|
|
1910
1171
|
} else if (paddingLength > diffs[0][1].length) {
|
|
1911
|
-
|
|
1912
|
-
var extraLength = paddingLength - diffs[0][1].length;
|
|
1172
|
+
const extraLength = paddingLength - diffs[0][1].length;
|
|
1913
1173
|
diffs[0][1] = nullPadding.substring(diffs[0][1].length) + diffs[0][1];
|
|
1914
1174
|
patch.start1 -= extraLength;
|
|
1915
1175
|
patch.start2 -= extraLength;
|
|
1916
1176
|
patch.length1 += extraLength;
|
|
1917
1177
|
patch.length2 += extraLength;
|
|
1918
1178
|
}
|
|
1919
|
-
|
|
1920
|
-
// Add some padding on end of last diff.
|
|
1921
1179
|
patch = patches[patches.length - 1];
|
|
1922
1180
|
diffs = patch.diffs;
|
|
1923
|
-
if (diffs.length
|
|
1924
|
-
|
|
1925
|
-
diffs.push([DIFF_EQUAL, nullPadding]);
|
|
1181
|
+
if (diffs.length === 0 || diffs[diffs.length - 1][0] !== DIFF_EQUAL) {
|
|
1182
|
+
diffs.push(createDiff(DIFF_EQUAL, nullPadding));
|
|
1926
1183
|
patch.length1 += paddingLength;
|
|
1927
1184
|
patch.length2 += paddingLength;
|
|
1928
1185
|
} else if (paddingLength > diffs[diffs.length - 1][1].length) {
|
|
1929
|
-
|
|
1930
|
-
var extraLength = paddingLength - diffs[diffs.length - 1][1].length;
|
|
1186
|
+
const extraLength = paddingLength - diffs[diffs.length - 1][1].length;
|
|
1931
1187
|
diffs[diffs.length - 1][1] += nullPadding.substring(0, extraLength);
|
|
1932
1188
|
patch.length1 += extraLength;
|
|
1933
1189
|
patch.length2 += extraLength;
|
|
1934
1190
|
}
|
|
1935
|
-
|
|
1936
1191
|
return nullPadding;
|
|
1937
|
-
}
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
* limit of the match algorithm.
|
|
1943
|
-
* Intended to be called only from within patch_apply.
|
|
1944
|
-
* @param {!Array.<!diff_match_patch.patch_obj>} patches Array of Patch objects.
|
|
1945
|
-
*/
|
|
1946
|
-
diff_match_patch.prototype.patch_splitMax = function(patches) {
|
|
1947
|
-
var patch_size = this.Match_MaxBits;
|
|
1948
|
-
for (var x = 0; x < patches.length; x++) {
|
|
1949
|
-
if (patches[x].length1 <= patch_size) {
|
|
1192
|
+
}
|
|
1193
|
+
function patchSplitMax(patches, options) {
|
|
1194
|
+
const resolved = resolveOptions(options);
|
|
1195
|
+
for (let x = 0; x < patches.length; x++) {
|
|
1196
|
+
if (patches[x].length1 <= resolved.matchMaxBits)
|
|
1950
1197
|
continue;
|
|
1951
|
-
|
|
1952
|
-
var bigpatch = patches[x];
|
|
1953
|
-
// Remove the big old patch.
|
|
1198
|
+
const bigpatch = patches[x];
|
|
1954
1199
|
patches.splice(x--, 1);
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1200
|
+
let start1 = bigpatch.start1;
|
|
1201
|
+
let start2 = bigpatch.start2;
|
|
1202
|
+
let precontext = "";
|
|
1958
1203
|
while (bigpatch.diffs.length !== 0) {
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
var empty = true;
|
|
1204
|
+
const patch = createPatch();
|
|
1205
|
+
let empty = true;
|
|
1962
1206
|
patch.start1 = start1 - precontext.length;
|
|
1963
1207
|
patch.start2 = start2 - precontext.length;
|
|
1964
|
-
if (precontext !==
|
|
1208
|
+
if (precontext !== "") {
|
|
1965
1209
|
patch.length1 = patch.length2 = precontext.length;
|
|
1966
|
-
patch.diffs.push(
|
|
1210
|
+
patch.diffs.push(createDiff(DIFF_EQUAL, precontext));
|
|
1967
1211
|
}
|
|
1968
|
-
while (bigpatch.diffs.length !== 0 &&
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
var diff_text = bigpatch.diffs[0][1];
|
|
1212
|
+
while (bigpatch.diffs.length !== 0 && patch.length1 < resolved.matchMaxBits - resolved.patchMargin) {
|
|
1213
|
+
const diff_type = bigpatch.diffs[0][0];
|
|
1214
|
+
let diff_text = bigpatch.diffs[0][1];
|
|
1972
1215
|
if (diff_type === DIFF_INSERT) {
|
|
1973
|
-
// Insertions are harmless.
|
|
1974
1216
|
patch.length2 += diff_text.length;
|
|
1975
1217
|
start2 += diff_text.length;
|
|
1976
1218
|
patch.diffs.push(bigpatch.diffs.shift());
|
|
1977
1219
|
empty = false;
|
|
1978
|
-
} else if (diff_type === DIFF_DELETE && patch.diffs.length
|
|
1979
|
-
patch.diffs[0][0] == DIFF_EQUAL &&
|
|
1980
|
-
diff_text.length > 2 * patch_size) {
|
|
1981
|
-
// This is a large deletion. Let it pass in one chunk.
|
|
1220
|
+
} else if (diff_type === DIFF_DELETE && patch.diffs.length === 1 && patch.diffs[0][0] === DIFF_EQUAL && diff_text.length > 2 * resolved.matchMaxBits) {
|
|
1982
1221
|
patch.length1 += diff_text.length;
|
|
1983
1222
|
start1 += diff_text.length;
|
|
1984
1223
|
empty = false;
|
|
1985
|
-
patch.diffs.push(
|
|
1224
|
+
patch.diffs.push(createDiff(diff_type, diff_text));
|
|
1986
1225
|
bigpatch.diffs.shift();
|
|
1987
1226
|
} else {
|
|
1988
|
-
|
|
1989
|
-
diff_text = diff_text.substring(0,
|
|
1990
|
-
patch_size - patch.length1 - this.Patch_Margin);
|
|
1227
|
+
diff_text = diff_text.substring(0, resolved.matchMaxBits - patch.length1 - resolved.patchMargin);
|
|
1991
1228
|
patch.length1 += diff_text.length;
|
|
1992
1229
|
start1 += diff_text.length;
|
|
1993
1230
|
if (diff_type === DIFF_EQUAL) {
|
|
@@ -1996,197 +1233,171 @@ diff_match_patch.prototype.patch_splitMax = function(patches) {
|
|
|
1996
1233
|
} else {
|
|
1997
1234
|
empty = false;
|
|
1998
1235
|
}
|
|
1999
|
-
patch.diffs.push(
|
|
2000
|
-
if (diff_text
|
|
1236
|
+
patch.diffs.push(createDiff(diff_type, diff_text));
|
|
1237
|
+
if (diff_text === bigpatch.diffs[0][1]) {
|
|
2001
1238
|
bigpatch.diffs.shift();
|
|
2002
1239
|
} else {
|
|
2003
|
-
bigpatch.diffs[0][1] =
|
|
2004
|
-
bigpatch.diffs[0][1].substring(diff_text.length);
|
|
1240
|
+
bigpatch.diffs[0][1] = bigpatch.diffs[0][1].substring(diff_text.length);
|
|
2005
1241
|
}
|
|
2006
1242
|
}
|
|
2007
1243
|
}
|
|
2008
|
-
|
|
2009
|
-
precontext =
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
// Append the end context for this patch.
|
|
2013
|
-
var postcontext = this.diff_text1(bigpatch.diffs)
|
|
2014
|
-
.substring(0, this.Patch_Margin);
|
|
2015
|
-
if (postcontext !== '') {
|
|
1244
|
+
precontext = diffText2(patch.diffs);
|
|
1245
|
+
precontext = precontext.substring(precontext.length - resolved.patchMargin);
|
|
1246
|
+
const postcontext = diffText1(bigpatch.diffs).substring(0, resolved.patchMargin);
|
|
1247
|
+
if (postcontext !== "") {
|
|
2016
1248
|
patch.length1 += postcontext.length;
|
|
2017
1249
|
patch.length2 += postcontext.length;
|
|
2018
|
-
if (patch.diffs.length !== 0 &&
|
|
2019
|
-
patch.diffs[patch.diffs.length - 1][0] === DIFF_EQUAL) {
|
|
1250
|
+
if (patch.diffs.length !== 0 && patch.diffs[patch.diffs.length - 1][0] === DIFF_EQUAL) {
|
|
2020
1251
|
patch.diffs[patch.diffs.length - 1][1] += postcontext;
|
|
2021
1252
|
} else {
|
|
2022
|
-
patch.diffs.push(
|
|
1253
|
+
patch.diffs.push(createDiff(DIFF_EQUAL, postcontext));
|
|
2023
1254
|
}
|
|
2024
1255
|
}
|
|
2025
|
-
if (!empty)
|
|
1256
|
+
if (!empty)
|
|
2026
1257
|
patches.splice(++x, 0, patch);
|
|
2027
|
-
}
|
|
2028
1258
|
}
|
|
2029
1259
|
}
|
|
2030
|
-
}
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
* Take a list of patches and return a textual representation.
|
|
2035
|
-
* @param {!Array.<!diff_match_patch.patch_obj>} patches Array of Patch objects.
|
|
2036
|
-
* @return {string} Text representation of patches.
|
|
2037
|
-
*/
|
|
2038
|
-
diff_match_patch.prototype.patch_toText = function(patches) {
|
|
2039
|
-
var text = [];
|
|
2040
|
-
for (var x = 0; x < patches.length; x++) {
|
|
1260
|
+
}
|
|
1261
|
+
function patchToText(patches) {
|
|
1262
|
+
const text = [];
|
|
1263
|
+
for (let x = 0; x < patches.length; x++)
|
|
2041
1264
|
text[x] = patches[x];
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
/**
|
|
2048
|
-
* Parse a textual representation of patches and return a list of Patch objects.
|
|
2049
|
-
* @param {string} textline Text representation of patches.
|
|
2050
|
-
* @return {!Array.<!diff_match_patch.patch_obj>} Array of Patch objects.
|
|
2051
|
-
* @throws {!Error} If invalid input.
|
|
2052
|
-
*/
|
|
2053
|
-
diff_match_patch.prototype.patch_fromText = function(textline) {
|
|
2054
|
-
var patches = [];
|
|
2055
|
-
if (!textline) {
|
|
1265
|
+
return text.join("");
|
|
1266
|
+
}
|
|
1267
|
+
function patchFromText(textline) {
|
|
1268
|
+
const patches = [];
|
|
1269
|
+
if (!textline)
|
|
2056
1270
|
return patches;
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
var patchHeader = /^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;
|
|
1271
|
+
const text = textline.split("\n");
|
|
1272
|
+
let textPointer = 0;
|
|
1273
|
+
const patchHeader = /^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;
|
|
2061
1274
|
while (textPointer < text.length) {
|
|
2062
|
-
|
|
2063
|
-
if (!m)
|
|
2064
|
-
throw new Error(
|
|
2065
|
-
|
|
2066
|
-
var patch = new diff_match_patch.patch_obj();
|
|
1275
|
+
const m = text[textPointer].match(patchHeader);
|
|
1276
|
+
if (!m)
|
|
1277
|
+
throw new Error(`Invalid patch string: ${text[textPointer]}`);
|
|
1278
|
+
const patch = createPatch();
|
|
2067
1279
|
patches.push(patch);
|
|
2068
|
-
patch.start1 = parseInt(m[1], 10);
|
|
2069
|
-
if (m[2] ===
|
|
1280
|
+
patch.start1 = Number.parseInt(m[1], 10);
|
|
1281
|
+
if (m[2] === "") {
|
|
2070
1282
|
patch.start1--;
|
|
2071
1283
|
patch.length1 = 1;
|
|
2072
|
-
} else if (m[2]
|
|
1284
|
+
} else if (m[2] === "0") {
|
|
2073
1285
|
patch.length1 = 0;
|
|
2074
1286
|
} else {
|
|
2075
1287
|
patch.start1--;
|
|
2076
|
-
patch.length1 = parseInt(m[2], 10);
|
|
1288
|
+
patch.length1 = Number.parseInt(m[2], 10);
|
|
2077
1289
|
}
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
if (m[4] === '') {
|
|
1290
|
+
patch.start2 = Number.parseInt(m[3], 10);
|
|
1291
|
+
if (m[4] === "") {
|
|
2081
1292
|
patch.start2--;
|
|
2082
1293
|
patch.length2 = 1;
|
|
2083
|
-
} else if (m[4]
|
|
1294
|
+
} else if (m[4] === "0") {
|
|
2084
1295
|
patch.length2 = 0;
|
|
2085
1296
|
} else {
|
|
2086
1297
|
patch.start2--;
|
|
2087
|
-
patch.length2 = parseInt(m[4], 10);
|
|
1298
|
+
patch.length2 = Number.parseInt(m[4], 10);
|
|
2088
1299
|
}
|
|
2089
1300
|
textPointer++;
|
|
2090
|
-
|
|
2091
1301
|
while (textPointer < text.length) {
|
|
2092
|
-
|
|
1302
|
+
const sign = text[textPointer].charAt(0);
|
|
1303
|
+
let line = "";
|
|
2093
1304
|
try {
|
|
2094
|
-
|
|
2095
|
-
} catch (
|
|
2096
|
-
|
|
2097
|
-
throw new Error('Illegal escape in patch_fromText: ' + line);
|
|
1305
|
+
line = decodeURI(text[textPointer].substring(1));
|
|
1306
|
+
} catch (e) {
|
|
1307
|
+
throw new Error(`Illegal escape in patch_fromText: ${line}`);
|
|
2098
1308
|
}
|
|
2099
|
-
if (sign
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
patch.diffs.push(
|
|
2105
|
-
} else if (sign
|
|
2106
|
-
// Minor equality.
|
|
2107
|
-
patch.diffs.push([DIFF_EQUAL, line]);
|
|
2108
|
-
} else if (sign == '@') {
|
|
2109
|
-
// Start of next patch.
|
|
1309
|
+
if (sign === "-") {
|
|
1310
|
+
patch.diffs.push(createDiff(DIFF_DELETE, line));
|
|
1311
|
+
} else if (sign === "+") {
|
|
1312
|
+
patch.diffs.push(createDiff(DIFF_INSERT, line));
|
|
1313
|
+
} else if (sign === " ") {
|
|
1314
|
+
patch.diffs.push(createDiff(DIFF_EQUAL, line));
|
|
1315
|
+
} else if (sign === "@") {
|
|
2110
1316
|
break;
|
|
2111
|
-
} else if (sign ===
|
|
2112
|
-
|
|
2113
|
-
} else {
|
|
2114
|
-
// WTF?
|
|
2115
|
-
throw new Error('Invalid patch mode "' + sign + '" in: ' + line);
|
|
1317
|
+
} else if (sign === "") ; else {
|
|
1318
|
+
throw new Error(`Invalid patch mode "${sign}" in: ${line}`);
|
|
2116
1319
|
}
|
|
2117
1320
|
textPointer++;
|
|
2118
1321
|
}
|
|
2119
1322
|
}
|
|
2120
1323
|
return patches;
|
|
2121
|
-
}
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
}
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
} else {
|
|
2162
|
-
coords2 = (this.start2 + 1) + ',' + this.length2;
|
|
2163
|
-
}
|
|
2164
|
-
var text = ['@@ -' + coords1 + ' +' + coords2 + ' @@\n'];
|
|
2165
|
-
var op;
|
|
2166
|
-
// Escape the body of the patch with %xx notation.
|
|
2167
|
-
for (var x = 0; x < this.diffs.length; x++) {
|
|
2168
|
-
switch (this.diffs[x][0]) {
|
|
2169
|
-
case DIFF_INSERT:
|
|
2170
|
-
op = '+';
|
|
2171
|
-
break;
|
|
2172
|
-
case DIFF_DELETE:
|
|
2173
|
-
op = '-';
|
|
2174
|
-
break;
|
|
2175
|
-
case DIFF_EQUAL:
|
|
2176
|
-
op = ' ';
|
|
2177
|
-
break;
|
|
1324
|
+
}
|
|
1325
|
+
function createPatch() {
|
|
1326
|
+
const patch = {
|
|
1327
|
+
diffs: [],
|
|
1328
|
+
start1: null,
|
|
1329
|
+
start2: null,
|
|
1330
|
+
length1: 0,
|
|
1331
|
+
length2: 0
|
|
1332
|
+
};
|
|
1333
|
+
patch.toString = function() {
|
|
1334
|
+
let coords1, coords2;
|
|
1335
|
+
if (this.length1 === 0)
|
|
1336
|
+
coords1 = `${this.start1},0`;
|
|
1337
|
+
else if (this.length1 === 1)
|
|
1338
|
+
coords1 = this.start1 + 1;
|
|
1339
|
+
else
|
|
1340
|
+
coords1 = `${this.start1 + 1},${this.length1}`;
|
|
1341
|
+
if (this.length2 === 0)
|
|
1342
|
+
coords2 = `${this.start2},0`;
|
|
1343
|
+
else if (this.length2 === 1)
|
|
1344
|
+
coords2 = this.start2 + 1;
|
|
1345
|
+
else
|
|
1346
|
+
coords2 = `${this.start2 + 1},${this.length2}`;
|
|
1347
|
+
const text = [`@@ -${coords1} +${coords2} @@
|
|
1348
|
+
`];
|
|
1349
|
+
let op;
|
|
1350
|
+
for (let x = 0; x < this.diffs.length; x++) {
|
|
1351
|
+
switch (this.diffs[x][0]) {
|
|
1352
|
+
case DIFF_INSERT:
|
|
1353
|
+
op = "+";
|
|
1354
|
+
break;
|
|
1355
|
+
case DIFF_DELETE:
|
|
1356
|
+
op = "-";
|
|
1357
|
+
break;
|
|
1358
|
+
case DIFF_EQUAL:
|
|
1359
|
+
op = " ";
|
|
1360
|
+
break;
|
|
1361
|
+
}
|
|
1362
|
+
text[x + 1] = `${op + encodeURI(this.diffs[x][1])}
|
|
1363
|
+
`;
|
|
2178
1364
|
}
|
|
2179
|
-
text
|
|
2180
|
-
}
|
|
2181
|
-
return
|
|
2182
|
-
}
|
|
2183
|
-
|
|
1365
|
+
return text.join("").replace(/%20/g, " ");
|
|
1366
|
+
};
|
|
1367
|
+
return patch;
|
|
1368
|
+
}
|
|
2184
1369
|
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
1370
|
+
exports.DIFF_DELETE = DIFF_DELETE;
|
|
1371
|
+
exports.DIFF_EQUAL = DIFF_EQUAL;
|
|
1372
|
+
exports.DIFF_INSERT = DIFF_INSERT;
|
|
1373
|
+
exports.defaultOptions = defaultOptions;
|
|
1374
|
+
exports.diff = diffMain;
|
|
1375
|
+
exports.diffCharsToLines = diffCharsToLines;
|
|
1376
|
+
exports.diffCleanupEfficiency = diffCleanupEfficiency;
|
|
1377
|
+
exports.diffCleanupMerge = diffCleanupMerge;
|
|
1378
|
+
exports.diffCleanupSemantic = diffCleanupSemantic;
|
|
1379
|
+
exports.diffCleanupSemanticLossless = diffCleanupSemanticLossless;
|
|
1380
|
+
exports.diffCommonPrefix = diffCommonPrefix;
|
|
1381
|
+
exports.diffCommonSuffix = diffCommonSuffix;
|
|
1382
|
+
exports.diffFromDelta = diffFromDelta;
|
|
1383
|
+
exports.diffLevenshtein = diffLevenshtein;
|
|
1384
|
+
exports.diffLinesToChars = diffLinesToChars;
|
|
1385
|
+
exports.diffMain = diffMain;
|
|
1386
|
+
exports.diffPrettyHtml = diffPrettyHtml;
|
|
1387
|
+
exports.diffText1 = diffText1;
|
|
1388
|
+
exports.diffText2 = diffText2;
|
|
1389
|
+
exports.diffToDelta = diffToDelta;
|
|
1390
|
+
exports.diffXIndex = diffXIndex;
|
|
1391
|
+
exports.match = matchMain;
|
|
1392
|
+
exports.matchAlphabet = matchAlphabet;
|
|
1393
|
+
exports.matchBitap = matchBitap;
|
|
1394
|
+
exports.matchMain = matchMain;
|
|
1395
|
+
exports.patch = patchMake;
|
|
1396
|
+
exports.patchAddPadding = patchAddPadding;
|
|
1397
|
+
exports.patchApply = patchApply;
|
|
1398
|
+
exports.patchDeepCopy = patchDeepCopy;
|
|
1399
|
+
exports.patchFromText = patchFromText;
|
|
1400
|
+
exports.patchMake = patchMake;
|
|
1401
|
+
exports.patchSplitMax = patchSplitMax;
|
|
1402
|
+
exports.patchToText = patchToText;
|
|
1403
|
+
exports.resolveOptions = resolveOptions;
|