├── .github └── workflows │ ├── AppRun │ ├── appimg_cleanup.py │ ├── build-appimage.yml │ ├── checkqt5.yml │ ├── create_tag.yml │ ├── linux-build.yml │ ├── mac-build.yml │ ├── mac_arm64-build.yml │ ├── make_blog_post.yml │ ├── make_post.py │ ├── reset-lin-caches.txt │ ├── reset-mac-caches.txt │ ├── reset-mac_arm64-caches.txt │ ├── reset-win-caches.txt │ ├── win-build.yml │ └── winget.yml ├── .gitignore ├── .retired_appveyor.yml ├── .retired_travis.yml ├── AppEventFilter.cpp ├── AppEventFilter.h ├── AppearanceWidget.cpp ├── AppearanceWidget.h ├── CMakeLists.txt ├── CMakeLists6.txt ├── COPYING.txt ├── ChangeLog.txt ├── ClassInfo.cpp ├── ClassInfo.h ├── ClipEditor.cpp ├── ClipEditor.h ├── ClipEditor.ui ├── ClipEditorModel.cpp ├── ClipEditorModel.h ├── ClipEditorTreeView.cpp ├── ClipEditorTreeView.h ├── ClipsWindow.cpp ├── ClipsWindow.h ├── ElementIndex.h ├── FocusSelectLineEdit.cpp ├── FocusSelectLineEdit.h ├── GeneralSettings.cpp ├── GeneralSettings.h ├── GumboInterface.cpp ├── GumboInterface.h ├── HTMLEncodingResolver.cpp ├── HTMLEncodingResolver.h ├── Inspector.cpp ├── Inspector.h ├── MainApplication.cpp ├── MainApplication.h ├── MainWindow.cpp ├── MainWindow.h ├── OPFReader.cpp ├── OPFReader.h ├── PAppearanceWidget.ui ├── PEDarkStyle.cpp ├── PEDarkStyle.h ├── PGeneralSettings.ui ├── Preferences.cpp ├── Preferences.h ├── Preferences.ui ├── PreferencesWidget.h ├── QuickParser.cpp ├── QuickParser.h ├── README.md ├── SearchToolbar.cpp ├── SearchToolbar.h ├── SearchToolbar.ui ├── SelectCharacter.cpp ├── SelectCharacter.h ├── SelectCharacter.ui ├── SelectFiles.cpp ├── SelectFiles.h ├── SelectFiles.ui ├── SelectHyperlink.cpp ├── SelectHyperlink.h ├── SelectHyperlink.ui ├── SelectId.cpp ├── SelectId.h ├── SelectId.ui ├── SettingsStore.cpp ├── SettingsStore.h ├── SimplePage.cpp ├── SimplePage.h ├── TagAtts.cpp ├── TagAtts.h ├── TagLister.cpp ├── TagLister.h ├── UIDictionary.cpp ├── UIDictionary.h ├── UILanguage.cpp ├── UILanguage.h ├── URLInterceptor.cpp ├── URLInterceptor.h ├── Utility.cpp ├── Utility.h ├── Viewer.h ├── WebPageEdit.cpp ├── WebPageEdit.h ├── WebProfileMgr.cpp ├── WebProfileMgr.h ├── WebViewEdit.cpp ├── WebViewEdit.h ├── Zoomable.h ├── ci_scripts ├── gddeploy.py ├── newgddeploy.py ├── rpath_adjust.sh └── winget │ ├── Sigil-Ebook.PageEdit.installer.yaml │ ├── Sigil-Ebook.PageEdit.locale.en-US.yaml │ ├── Sigil-Ebook.PageEdit.yaml │ └── build.ps1 ├── dark ├── close-hover.svg ├── closetab-hover.svg ├── closetab-mini.svg ├── closetab-pressed.svg ├── dark.qrc ├── dock-close-hover.svg ├── dock-close.svg ├── lin_dark_scrollbar.css ├── mac_dark_scrollbar.css ├── undock-hover.svg ├── undock.svg ├── win-dark-style.qss └── win_dark_scrollbar.css ├── dictionaries ├── About.txt ├── COPYING_GPLv2.txt ├── COPYING_GPLv3.txt ├── COPYING_LGPL_v2.0.txt ├── COPYING_LGPL_v2.1.txt ├── README.txt ├── README_de_DE_frami.txt ├── README_en_GB.txt ├── README_en_US.txt ├── README_es_ANY.txt ├── README_extension_owner.txt ├── README_fr.txt ├── README_hyph_de.txt ├── README_hyph_en_GB.txt ├── README_hyph_en_US.txt ├── README_hyph_es_ANY.txt ├── README_hyph_fr.txt ├── de_DE.aff ├── de_DE.dic ├── en_GB.aff ├── en_GB.dic ├── en_US.aff ├── en_US.dic ├── es.aff ├── es.dic ├── fr.aff ├── fr.dic ├── hyph_de_DE.dic ├── hyph_en_GB.dic ├── hyph_en_US.dic ├── hyph_es.dic ├── hyph_fr.dic └── license.txt ├── examples └── clip_entries.ini ├── gumbo_subtree ├── .appveyor.yml ├── .gitignore ├── .gitmodules ├── .travis.yml ├── CMakeLists.txt ├── COPYING ├── ChangeLog.txt ├── README.md ├── THANKS ├── archived_upstream │ ├── CHANGES.md │ ├── CONTRIBUTING.md │ ├── DEBUGGING.md │ ├── Doxyfile │ ├── Makefile.am │ ├── README.md │ ├── autogen.sh │ ├── benchmarks │ │ ├── arabic_newspapers.html │ │ ├── baidu.html │ │ ├── bbc.html │ │ ├── benchmark.cc │ │ ├── google.html │ │ ├── hacker_news.html │ │ ├── html5_spec.html │ │ ├── wikipedia.html │ │ ├── xinhua.html │ │ └── yahoo.html │ ├── configure.ac │ ├── gumbo.pc.in │ ├── gumbo_parser.gyp │ └── setup.py ├── examples │ ├── CMakeLists.txt │ ├── clean_text.cc │ ├── find_links.cc │ ├── get_title.c │ ├── positions_of_class.cc │ ├── prettyprint.cc │ ├── serialize.cc │ └── well_formed.cc ├── gentags.py ├── python │ └── gumbo │ │ ├── __init__.py │ │ ├── bs4_adapter.py │ │ ├── bs4_adapter_test.py │ │ ├── gumboc.py │ │ ├── gumboc_tags.py │ │ ├── gumboc_test.py │ │ ├── html5lib_adapter.py │ │ ├── html5lib_adapter_test.py │ │ ├── soup_adapter.py │ │ └── soup_adapter_test.py ├── src │ ├── CMakeLists.txt │ ├── attribute.c │ ├── attribute.h │ ├── char_ref.c │ ├── char_ref.h │ ├── char_ref.rl │ ├── error.c │ ├── error.h │ ├── foreign_attrs.c │ ├── foreign_attrs.gperf │ ├── gumbo.h │ ├── gumbo_edit.c │ ├── gumbo_edit.h │ ├── insertion_mode.h │ ├── parser.c │ ├── parser.h │ ├── replacement.h │ ├── string_buffer.c │ ├── string_buffer.h │ ├── string_piece.c │ ├── string_piece.h │ ├── svg_attrs.c │ ├── svg_attrs.gperf │ ├── svg_tags.c │ ├── svg_tags.gperf │ ├── tag.c │ ├── tag.in │ ├── tag_enum.h │ ├── tag_perf.h │ ├── tag_sizes.h │ ├── tag_strings.h │ ├── token_type.h │ ├── tokenizer.c │ ├── tokenizer.h │ ├── tokenizer_states.h │ ├── utf8.c │ ├── utf8.h │ ├── util.c │ ├── util.h │ ├── vector.c │ └── vector.h ├── testdata │ ├── AUTHORS.rst │ ├── LICENSE │ ├── encoding │ │ ├── chardet │ │ │ └── test_big5.txt │ │ ├── scripted │ │ │ └── tests1.dat │ │ ├── test-yahoo-jp.dat │ │ ├── tests1.dat │ │ └── tests2.dat │ ├── serializer │ │ ├── core.test │ │ ├── injectmeta.test │ │ ├── optionaltags.test │ │ ├── options.test │ │ └── whitespace.test │ ├── tokenizer │ │ ├── README.md │ │ ├── contentModelFlags.test │ │ ├── domjs.test │ │ ├── entities.test │ │ ├── escapeFlag.test │ │ ├── namedEntities.test │ │ ├── numericEntities.test │ │ ├── pendingSpecChanges.test │ │ ├── test1.test │ │ ├── test2.test │ │ ├── test3.test │ │ ├── test4.test │ │ ├── unicodeChars.test │ │ ├── unicodeCharsProblematic.test │ │ └── xmlViolation.test │ └── tree-construction │ │ ├── README.md │ │ ├── adoption01.dat │ │ ├── adoption02.dat │ │ ├── blocks.dat │ │ ├── comments01.dat │ │ ├── doctype01.dat │ │ ├── domjs-unsafe.dat │ │ ├── entities01.dat │ │ ├── entities02.dat │ │ ├── foreign-fragment.dat │ │ ├── html5test-com.dat │ │ ├── inbody01.dat │ │ ├── isindex.dat │ │ ├── main-element.dat │ │ ├── math.dat │ │ ├── menuitem-element.dat │ │ ├── namespace-sensitivity.dat │ │ ├── noscript01.dat │ │ ├── pending-spec-changes-plain-text-unsafe.dat │ │ ├── pending-spec-changes.dat │ │ ├── plain-text-unsafe.dat │ │ ├── ruby.dat │ │ ├── scriptdata01.dat │ │ ├── scripted │ │ ├── adoption01.dat │ │ ├── ark.dat │ │ └── webkit01.dat │ │ ├── search-element.dat │ │ ├── svg.dat │ │ ├── tables01.dat │ │ ├── template.dat │ │ ├── tests1.dat │ │ ├── tests10.dat │ │ ├── tests11.dat │ │ ├── tests12.dat │ │ ├── tests14.dat │ │ ├── tests15.dat │ │ ├── tests16.dat │ │ ├── tests17.dat │ │ ├── tests18.dat │ │ ├── tests19.dat │ │ ├── tests2.dat │ │ ├── tests20.dat │ │ ├── tests21.dat │ │ ├── tests22.dat │ │ ├── tests23.dat │ │ ├── tests24.dat │ │ ├── tests25.dat │ │ ├── tests26.dat │ │ ├── tests3.dat │ │ ├── tests4.dat │ │ ├── tests5.dat │ │ ├── tests6.dat │ │ ├── tests7.dat │ │ ├── tests8.dat │ │ ├── tests9.dat │ │ ├── tests_innerHTML_1.dat │ │ ├── tricky01.dat │ │ ├── webkit01.dat │ │ └── webkit02.dat ├── tests │ ├── CMakeLists.txt │ ├── attribute.cc │ ├── char_ref.cc │ ├── parser.cc │ ├── string_buffer.cc │ ├── string_piece.cc │ ├── test_utils.cc │ ├── test_utils.h │ ├── tokenizer.cc │ ├── utf8.cc │ └── vector.cc └── visualc │ └── include │ ├── gumbo_windll.def │ └── strings.h ├── icons ├── PageEdit.icns ├── app.ico ├── app_icon_128.png ├── app_icon_256.png ├── app_icon_32.png ├── app_icon_48.png ├── app_icon_512.png ├── app_icon_scalable.svg ├── arrow-left.svg ├── arrow-right.svg ├── back-link.svg ├── document-open.svg ├── document-print.svg ├── document-save.svg ├── document-spellcheck.svg ├── edit-copy.svg ├── edit-cut.svg ├── edit-find.svg ├── edit-paste.svg ├── edit-redo.svg ├── edit-select-all.svg ├── edit-undo.svg ├── find-next.svg ├── find-previous.svg ├── format-case-capitalize.svg ├── format-case-lowercase.svg ├── format-case-titlecase.svg ├── format-case-uppercase.svg ├── format-indent-less.svg ├── format-indent-more.svg ├── format-justify-center.svg ├── format-justify-fill.svg ├── format-justify-left.svg ├── format-justify-right.svg ├── format-text-bold.svg ├── format-text-italic.svg ├── format-text-strikethrough.svg ├── format-text-subscript.svg ├── format-text-superscript.svg ├── format-text-underline.svg ├── heading-1.svg ├── heading-2.svg ├── heading-3.svg ├── heading-4.svg ├── heading-5.svg ├── heading-6.svg ├── heading-all.svg ├── heading-normal.svg ├── help-browser.svg ├── icon.rc ├── icons.qrc ├── insert-bullet-list.svg ├── insert-hyperlink.svg ├── insert-id.svg ├── insert-image.svg ├── insert-numbered-list.svg ├── insert-special-character.svg ├── inspect.svg ├── list-add.svg ├── list-remove.svg ├── mode-edit.svg ├── mode-preview.svg ├── process-stop.svg ├── reload-page.svg ├── split-section.svg ├── widget-close.svg └── xhtml.icns ├── installer ├── PageEdit.iss └── win_installer_note.txt ├── javascript ├── book_view_current_location.js ├── format_block.js ├── get_ancestor.js ├── get_ancestor_attribute.js ├── get_block.js ├── javascript.qrc ├── jquery-3.6.4.min.js ├── jquery.scrollTo-2.1.2-min.js └── set_ancestor_attribute.js ├── macos_menu_and_window_fixes.mm ├── main.cpp ├── main.ui ├── pageedit_constants.cpp ├── pageedit_constants.h ├── pageedit_exception.h ├── platform ├── linux │ ├── bash │ │ └── pageedit-sh_install │ └── freedesktop │ │ ├── pageedit-appimage.desktop │ │ └── pageedit.desktop └── mac │ └── MacOSXBundleInfo.plist ├── screencaps ├── add-links.png ├── dark-mode.png ├── insert-image.png ├── insert-special-chars.png ├── inspector.png └── pageedit.png ├── ts ├── base_pageedit.ts ├── pageedit_ar.ts ├── pageedit_cs.ts ├── pageedit_da_DK.ts ├── pageedit_de.ts ├── pageedit_en.ts ├── pageedit_es.ts ├── pageedit_fi.ts ├── pageedit_fr.ts ├── pageedit_hu_HU.ts ├── pageedit_it.ts ├── pageedit_ja.ts ├── pageedit_ko.ts ├── pageedit_nl.ts ├── pageedit_pl.ts ├── pageedit_pt_BR.ts ├── pageedit_ru.ts ├── pageedit_sr.ts ├── pageedit_tr.ts ├── pageedit_uk.ts └── pageedit_zh_CN.ts ├── version.rc.in ├── webviewprinter.cpp └── webviewprinter.h /.github/workflows/AppRun: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # make sure errors in sourced scripts will cause this script to stop 4 | set -e 5 | 6 | this_dir="$(readlink -f "$(dirname "$0")")" 7 | 8 | #PAGEEDIT_EXTRA_ROOT="$this_dir/usr/share/pageedit" 9 | #export PAGEEDIT_EXTRA_ROOT 10 | #echo "${PAGEEDIT_EXTRA_ROOT}" 11 | 12 | # LD_LIBRARY_PATH="$this_dir/usr/lib:$LD_LIBRARY_PATH" 13 | # export LD_LIBRARY_PATH 14 | # echo "$LD_LIBRARY_PATH" 15 | 16 | source "$this_dir"/apprun-hooks/"linuxdeploy-plugin-qt-hook.sh" 17 | 18 | LD_LIBRARY_PATH="$this_dir/usr/lib:$LD_LIBRARY_PATH" exec "$this_dir"/AppRun.wrapped "$@" 19 | -------------------------------------------------------------------------------- /.github/workflows/checkqt5.yml: -------------------------------------------------------------------------------- 1 | name: Test PageEdit Qt5 Compatibility 2 | 3 | on: 4 | workflow_dispatch: 5 | branches: master 6 | 7 | env: 8 | BUILD_TYPE: Debug 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v4 16 | 17 | - name: Cache Qt 18 | id: cache-qt 19 | uses: actions/cache@v4 20 | with: 21 | path: ${{runner.workspace}}/Qt 22 | key: ${{ runner.os }}-qtdeps-${{ hashFiles('**/reset-lin-caches.txt') }} 23 | 24 | - name: Install Qt 25 | uses: jurplel/install-qt-action@v3 26 | with: 27 | version: '5.12.9' 28 | dir: ${{runner.workspace}}/Qt 29 | modules: 'qtwebengine' 30 | setup-python: 'true' 31 | cache: ${{ steps.cache-qt.outputs.cache-hit }} 32 | 33 | - uses: lukka/get-cmake@latest 34 | 35 | - name: Install dependencies 36 | run: | 37 | sudo apt install mesa-common-dev libglu1-mesa-dev 38 | mkdir ${{runner.workspace}}/build 39 | cmake --version 40 | ninja --version 41 | qmake -v 42 | gcc --version 43 | 44 | - name: Build PageEdit 45 | working-directory: ${{runner.workspace}}/build 46 | run: | 47 | cmake $GITHUB_WORKSPACE \ 48 | -G "Ninja" \ 49 | -DUSE_QT5=1 \ 50 | -DCMAKE_PREFIX_PATH="{$QT_ROOT_DIR}/lib/cmake" \ 51 | -DCMAKE_BUILD_TYPE=$BUILD_TYPE 52 | ninja -j$(getconf _NPROCESSORS_ONLN) 53 | -------------------------------------------------------------------------------- /.github/workflows/linux-build.yml: -------------------------------------------------------------------------------- 1 | name: Build PageEdit on Linux 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | tags-ignore: 7 | - '**' 8 | paths-ignore: 9 | - 'docs/**' 10 | - 'installer/win_installer_note.txt' 11 | - 'ChangeLog.txt' 12 | - 'COPYING.txt' 13 | - 'version.xml' 14 | - 'appveyor.yml' 15 | - '.retired_travis.yml' 16 | - '.retired_appveyor.yml' 17 | - '**.md' 18 | 19 | pull_request: 20 | branches: [ master ] 21 | tags-ignore: 22 | - '**' 23 | paths-ignore: 24 | - 'docs/**' 25 | - 'installer/win_installer_note.txt' 26 | - 'ChangeLog.txt' 27 | - 'COPYING.txt' 28 | - 'version.xml' 29 | - 'appveyor.yml' 30 | - '.retired_travis.yml' 31 | - '.retired_appveyor.yml' 32 | - '**.md' 33 | 34 | env: 35 | BUILD_TYPE: Debug 36 | 37 | jobs: 38 | build: 39 | if: "!contains(github.event.head_commit.message, '[skip ci]')" 40 | runs-on: ubuntu-latest 41 | 42 | steps: 43 | - uses: actions/checkout@v4 44 | 45 | - name: Cache Qt 46 | id: cache-qt 47 | uses: actions/cache@v4 48 | with: 49 | path: ${{runner.workspace}}/Qt 50 | key: ${{ runner.os }}-qtdeps-${{ hashFiles('**/reset-lin-caches.txt') }} 51 | 52 | - name: Install Qt 53 | uses: jurplel/install-qt-action@v3 54 | with: 55 | version: '6.4.0' 56 | dir: ${{runner.workspace}}/Qt 57 | modules: 'qtwebengine qtpositioning qt5compat qtpdf qtwebchannel' 58 | setup-python: 'true' 59 | cache: ${{ steps.cache-qt.outputs.cache-hit }} 60 | 61 | - uses: lukka/get-cmake@latest 62 | 63 | - name: Install dependencies 64 | run: | 65 | sudo apt install mesa-common-dev libglu1-mesa-dev 66 | mkdir ${{runner.workspace}}/build 67 | cmake --version 68 | ninja --version 69 | qmake -v 70 | gcc --version 71 | 72 | - name: Build PageEdit 73 | working-directory: ${{runner.workspace}}/build 74 | run: | 75 | cmake $GITHUB_WORKSPACE \ 76 | -G "Ninja" \ 77 | -DCMAKE_PREFIX_PATH="{$QT_ROOT_DIR}/lib/cmake" \ 78 | -DCMAKE_BUILD_TYPE=$BUILD_TYPE 79 | ninja -j$(getconf _NPROCESSORS_ONLN) 80 | -------------------------------------------------------------------------------- /.github/workflows/make_blog_post.yml: -------------------------------------------------------------------------------- 1 | name: Make Blog Post 2 | 3 | on: 4 | # Only create blog post after new PageEdit release is published 5 | release: 6 | types: published 7 | 8 | jobs: 9 | post: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Get tag name 13 | id: get_tag_name 14 | run: echo "TAGNAME=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT 15 | 16 | - name: Checkout 17 | uses: actions/checkout@v4 18 | with: 19 | ref: master 20 | path: main 21 | 22 | - name: Checkout website 23 | uses: actions/checkout@v4 24 | with: 25 | token: ${{ secrets.ROBO_ACTIONS }} 26 | repository: sigil-ebook/sigil-ebook.github.io 27 | ref: master 28 | path: website 29 | 30 | - name: Get Release details 31 | run: | 32 | pip install python-dateutil 33 | echo "${{ github.event_path }}" 34 | python $GITHUB_WORKSPACE/main/.github/workflows/make_post.py -p ${{ github.event_path }} 35 | mv ./*.md $GITHUB_WORKSPACE/website/_posts 36 | 37 | - name: Commit post to blog 38 | if: "!github.event.release.prerelease" 39 | uses: stefanzweifel/git-auto-commit-action@v5 40 | with: 41 | repository: website 42 | commit_user_name: My GitHub Actions Bot 43 | commit_user_email: my-github-actions-bot@example.org 44 | commit_author: Author 45 | commit_message: Auto create ${{ steps.get_tag_name.outputs.TAGNAME }} release blog post 46 | branch: master 47 | 48 | # Trigger sigil-ebook.com to update its version info 49 | - name: Trigger Remote Workflow 50 | if: "!github.event.release.prerelease" 51 | run: | 52 | curl \ 53 | -X POST \ 54 | -H "Accept: application/vnd.github.v3+json" \ 55 | -H "Authorization: token ${{ secrets.ROBO_ACTIONS }}" \ 56 | https://api.github.com/repos/sigil-ebook/sigil-ebook.github.io/actions/workflows/check_versions.yml/dispatches \ 57 | -d '{"ref":"master"}' 58 | -------------------------------------------------------------------------------- /.github/workflows/reset-lin-caches.txt: -------------------------------------------------------------------------------- 1 | Change the content of this file to reset the caches for the github actions sigil linux build 2 | 3 | reset cache on 4 September 2023 4 | reset cache on 26 July 2024 5 | -------------------------------------------------------------------------------- /.github/workflows/reset-mac-caches.txt: -------------------------------------------------------------------------------- 1 | Change the content of this file to reset the caches for the github actions sigil macOS x86_64 build 2 | 3 | cleared cache on 30 April 2021 4 | cleared cache on 26 July 2023 5 | cleared cache on 08 September 2023 6 | cleared cache on 07 October 2023 7 | cleared cache on 15 February 2024 8 | cleared cache on 26 April 2024 9 | cleared cache on 25 July 2024 10 | cleared cache on 23 October 2024 11 | cleared cache on 05 February 2025 12 | cleared cache on 05 February 2025 again 13 | cleared cache on 28 February 2025 14 | 15 | -------------------------------------------------------------------------------- /.github/workflows/reset-mac_arm64-caches.txt: -------------------------------------------------------------------------------- 1 | Change the content of this file to reset the caches for the github actions sigil macOS arm64 build 2 | 3 | cleared cache on 25 July 2024 4 | cleared cache on 23 October 2024 5 | cleared cache on 05 February 2025 6 | cleared cache on 05 February 2025 again 7 | 8 | -------------------------------------------------------------------------------- /.github/workflows/reset-win-caches.txt: -------------------------------------------------------------------------------- 1 | Change the content of this file to reset the caches for the github actions sigil windows build 2 | 3 | reset cache on 26 July 2023 4 | reset cache on 26 August 2023 5 | reset cache on 4 September 2023 6 | reset cache on 9 September 2023 7 | reset cache on 12 October 2023 8 | reset cache on 19 November 2023 9 | reset cache on 25 March 2024 10 | reset cache on 26 July 2024 11 | reset cache on 23 October 2024 12 | reset cache on 5 February 2025 13 | -------------------------------------------------------------------------------- /.github/workflows/winget.yml: -------------------------------------------------------------------------------- 1 | name: Publish Release to WinGet 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | version: 6 | description: 'The latest version' 7 | required: true 8 | jobs: 9 | publish: 10 | runs-on: windows-latest 11 | defaults: 12 | run: 13 | shell: pwsh 14 | working-directory: ${{ github.workspace }}/ci_scripts/winget 15 | env: 16 | WINGET_TOKEN: ${{ secrets.WINGET_PAT }} 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@v4 20 | - name: Create manifest and submit PR 21 | run: | 22 | ./build.ps1 -Version "${{ github.event.inputs.version }}" 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Backup files left behind by the Emacs editor. 2 | *~ 3 | 4 | # Lock files used by the Emacs editor. 5 | .\#* 6 | 7 | # emacs auto recovery files from aborted edits 8 | \#*\# 9 | 10 | #use ful for stashing files 11 | *.orig 12 | *.keep 13 | 14 | # Temporary files used by the vim editor. 15 | .*.swp 16 | .swp 17 | 18 | # A hidden file created by the Mac OS X Finder. 19 | .DS_Store 20 | 21 | # Image thumbnail database created by windows 22 | Thumbs.db 23 | 24 | # Various files created by Visual Studio 25 | *.sln 26 | *.suo 27 | *.vcproj 28 | *.user* 29 | #*.rc 30 | *.ncb 31 | *.pch 32 | *.dep 33 | *.idb 34 | *.exp 35 | *.res 36 | *.manifest 37 | *.ilk 38 | *.pdb 39 | *.def 40 | Release 41 | Debug 42 | BuildLog.htm 43 | 44 | # Various files and folders created by CMake 45 | CMakeFiles 46 | CMakeScripts 47 | CMakeCache.txt 48 | *.cmake 49 | *.dir 50 | ALL_BUILD* 51 | 52 | # Misc files 53 | *.svn 54 | *.a 55 | *.o 56 | *.obj 57 | *.lib 58 | *.exe 59 | *.dll 60 | *.a 61 | *.app 62 | *.xcodeproj 63 | *.pbxbtree 64 | *.pbxindex 65 | *.build 66 | *.smp 67 | *.pl 68 | *.pyc 69 | *.pyo 70 | *.orig 71 | *.bak 72 | *.rar 73 | OpenCandy 74 | tags 75 | build 76 | 77 | # C++ objects and libs 78 | *.slo 79 | *.lo 80 | *.o 81 | *.a 82 | *.la 83 | *.lai 84 | *.so 85 | *.dll 86 | *.dylib 87 | 88 | # Qt-es 89 | object_script.*.Release 90 | object_script.*.Debug 91 | *_plugin_import.cpp 92 | /.qmake.cache 93 | /.qmake.stash 94 | *.pro.user 95 | *.pro.user.* 96 | *.qbs.user 97 | *.qbs.user.* 98 | *.moc 99 | moc_*.cpp 100 | moc_*.h 101 | qrc_*.cpp 102 | ui_*.h 103 | *.qmlc 104 | *.jsc 105 | Makefile* 106 | *build-* 107 | 108 | # Qt unit tests 109 | target_wrapper.* 110 | 111 | # QtCreator 112 | *.autosave 113 | 114 | # QtCreator Qml 115 | *.qmlproject.user 116 | *.qmlproject.user.* 117 | 118 | # QtCreator CMake 119 | CMakeLists.txt.user* 120 | 121 | # QtCreator 4.8< compilation database 122 | compile_commands.json 123 | 124 | # QtCreator local machine specific files for imported projects 125 | *creator.user* 126 | 127 | -------------------------------------------------------------------------------- /.retired_travis.yml: -------------------------------------------------------------------------------- 1 | os: osx 2 | language: c++ 3 | compiler: clang 4 | osx_image: xcode10.1 5 | 6 | env: 7 | global: 8 | - HOMEBREW_NO_AUTO_UPDATE=1 9 | - MACOSX_DEPLOYMENT_TARGET=10.12 10 | - QT_URL=https://github.com/kevinhendricks/BuildSigilOnMac/releases/download/for_sigil_1.0.0/Qt5129.tar.xz 11 | 12 | git: 13 | depth: 3 14 | 15 | install: 16 | - brew install gdrive 17 | - brew install xz 18 | - pwd 19 | - cd ~ 20 | # Retrieve custom Qt 21 | - wget $QT_URL 22 | - tar xzf Qt5129.tar.xz 23 | - export MYQTHOME=${HOME}/Qt5129 24 | # Add custom Qt to path 25 | - export PATH=${PATH}:${MYQTHOME}/bin 26 | # macdeployqt looks for qt plugins in a hard-coded compile-time location 27 | - sudo mkdir -p /Users/kbhend/Qt5129 28 | - sudo chown -R travis /Users/kbhend/ 29 | - cp -R ~/Qt5129/plugins /Users/kbhend/Qt5129 30 | 31 | 32 | script: 33 | - cd ~/build/${TRAVIS_REPO_SLUG} 34 | - mkdir build && cd build 35 | - pwd 36 | - cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 -DCMAKE_BUILD_TYPE=Release \ 37 | -DCMAKE_CXX_FLAGS=-Wno-inconsistent-missing-override \ 38 | -DCMAKE_PREFIX_PATH=${MYQTHOME}/lib/cmake \ 39 | -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/ ../ 40 | - make -j4 41 | - make addframeworks 42 | - cd ./bin 43 | # Don't make the xz archive on remote PRs 44 | - if [[ "$TRAVIS_SECURE_ENV_VARS" == true ]]; then 45 | tar -cJf PageEdit.tar.xz PageEdit.app; 46 | fi 47 | - cd ../ 48 | 49 | after_success: 50 | # Remote PRs won't set secure variables, so don't try to deploy 51 | - python3 --version 52 | - if [[ "$TRAVIS_SECURE_ENV_VARS" == true ]]; then 53 | python3 ../ci_scripts/gddeploy.py; 54 | fi 55 | 56 | -------------------------------------------------------------------------------- /AppEventFilter.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2019 Kevin B. Hendricks, Stratford, Ontario Canada 4 | ** Copyright (C) 2009, 2010, 2011 Strahinja Markovic 5 | ** 6 | ** This file is part of PageEdit. 7 | ** 8 | ** PageEdit is free software: you can redistribute it and/or modify 9 | ** it under the terms of the GNU General Public License as published by 10 | ** the Free Software Foundation, either version 3 of the License, or 11 | ** (at your option) any later version. 12 | ** 13 | ** PageEdit is distributed in the hope that it will be useful, 14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ** GNU General Public License for more details. 17 | ** 18 | ** You should have received a copy of the GNU General Public License 19 | ** along with PageEdit. If not, see . 20 | ** 21 | *************************************************************************/ 22 | 23 | #include 24 | 25 | #include "MainWindow.h" 26 | #include "AppEventFilter.h" 27 | 28 | // Constructor; 29 | // The argument is the object's parent. 30 | AppEventFilter::AppEventFilter(QObject *parent) 31 | : QObject(parent) 32 | { 33 | } 34 | 35 | QString AppEventFilter::getInitialFilePath() 36 | { 37 | return m_initialFilePath; 38 | } 39 | 40 | void AppEventFilter::setInitialFilePath(const QString& filepath) 41 | { 42 | m_initialFilePath = filepath; 43 | } 44 | 45 | // The event filter used to catch OS X's 46 | // QFileOpenEvents. These signal the user used the OS's 47 | // services to start Sigil with an existing document 48 | bool AppEventFilter::eventFilter(QObject *watched_object, QEvent *event) 49 | { 50 | if (event->type() == QEvent::FileOpen) { 51 | QFileOpenEvent *openEvent = static_cast(event); 52 | if (m_initialFilePath.isEmpty()) { 53 | m_initialFilePath = openEvent->file(); 54 | } else { 55 | MainWindow *widget = new MainWindow(openEvent->file()); 56 | widget->show(); 57 | } 58 | return true; 59 | } 60 | 61 | // standard event processing 62 | return QObject::eventFilter(watched_object, event); 63 | } 64 | -------------------------------------------------------------------------------- /AppEventFilter.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2019 Kevin B. Hendricks, Stratford, Ontario Canada 4 | ** Copyright (C) 2009, 2010, 2011 Strahinja Markovic 5 | ** 6 | ** This file is part of PageEdit. 7 | ** 8 | ** PageEdit is free software: you can redistribute it and/or modify 9 | ** it under the terms of the GNU General Public License as published by 10 | ** the Free Software Foundation, either version 3 of the License, or 11 | ** (at your option) any later version. 12 | ** 13 | ** PageEdit is distributed in the hope that it will be useful, 14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ** GNU General Public License for more details. 17 | ** 18 | ** You should have received a copy of the GNU General Public License 19 | ** along with PageEdit. If not, see . 20 | ** 21 | *************************************************************************/ 22 | 23 | #pragma once 24 | #ifndef APPEVENTFILTER_H 25 | #define APPEVENTFILTER_H 26 | 27 | #include 28 | #include 29 | 30 | class QEvent; 31 | 32 | class AppEventFilter : public QObject 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | 38 | // Constructor; 39 | // The argument is the object's parent. 40 | AppEventFilter(QObject *parent); 41 | 42 | QString getInitialFilePath(); 43 | void setInitialFilePath(const QString &filepath); 44 | 45 | protected: 46 | 47 | // The event filter used to catch OS X's 48 | // QFileOpenEvents. These signal the user used the OS's 49 | // services to start PageEdit with an existing document 50 | bool eventFilter(QObject *watched_object, QEvent *event); 51 | 52 | private: 53 | // any initial file passed in from OS when PageEdit first launched 54 | QString m_initialFilePath; 55 | 56 | }; 57 | 58 | #endif // APPEVENTFILTER_H 59 | 60 | 61 | -------------------------------------------------------------------------------- /AppearanceWidget.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2019-2020 Kevin B. Hendricks, Stratford, Ontario Canada 4 | ** Copyright (C) 2016-2024 Doug Massay 5 | ** Copyright (C) 2012 John Schember 6 | ** Copyright (C) 2012 Grant Drake 7 | ** 8 | ** This file is part of PageEdit. 9 | ** 10 | ** PageEdit is free software: you can redistribute it and/or modify 11 | ** it under the terms of the GNU General Public License as published by 12 | ** the Free Software Foundation, either version 3 of the License, or 13 | ** (at your option) any later version. 14 | ** 15 | ** PageEdit is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU General Public License for more details. 19 | ** 20 | ** You should have received a copy of the GNU General Public License 21 | ** along with PageEdit. If not, see . 22 | ** 23 | *************************************************************************/ 24 | 25 | #pragma once 26 | #ifndef APPEARANCEWIDGET_H 27 | #define APPEARANCEWIDGET_H 28 | 29 | #include "MainWindow.h" 30 | #include "SettingsStore.h" 31 | #include "PreferencesWidget.h" 32 | #include "ui_PAppearanceWidget.h" 33 | 34 | /** 35 | * Preferences widget for font/appearance related preferences. 36 | */ 37 | class AppearanceWidget : public PreferencesWidget 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | AppearanceWidget(); 43 | void readSettings(); 44 | PreferencesWidget::ResultActions saveSettings(); 45 | 46 | private slots: 47 | void changeUIFontButtonClicked(); 48 | void resetAllButtonClicked(); 49 | void newSliderValue(int value); 50 | 51 | private: 52 | void updateUIFontDisplay(); 53 | void loadComboValueOrDefault(QFontComboBox *fontComboBox, const QString &value, const QString &defaultValue); 54 | void connectSignalsToSlots(); 55 | 56 | Ui::AppearanceWidget ui; 57 | int m_PreviewDark; 58 | QString m_initUIFont; 59 | QString m_currentUIFont; 60 | bool m_uiFontResetFlag; 61 | bool m_UseCustomDarkTheme; 62 | }; 63 | 64 | #endif // APPEARANCEWIDGET_H 65 | -------------------------------------------------------------------------------- /ClipEditorTreeView.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) Kevin B. Hendricks, Stratford, Ontario Canada 4 | ** Copyright (C) 2012 John Schember 5 | ** Copyright (C) 2012 Dave Heiland 6 | ** Copyright (C) 2012 Grant Drake 7 | ** 8 | ** This file is part of PageEdit. 9 | ** 10 | ** PageEdit is free software: you can redistribute it and/or modify 11 | ** it under the terms of the GNU General Public License as published by 12 | ** the Free Software Foundation, either version 3 of the License, or 13 | ** (at your option) any later version. 14 | ** 15 | ** PageEdit is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU General Public License for more details. 19 | ** 20 | ** You should have received a copy of the GNU General Public License 21 | ** along with PageEdit. If not, see . 22 | ** 23 | *************************************************************************/ 24 | 25 | #pragma once 26 | #ifndef CLIPEDITORTREEVIEW_H 27 | #define CLIPEDITORTREEVIEW_H 28 | 29 | #include 30 | 31 | class ClipEditorTreeView : public QTreeView 32 | { 33 | 34 | public: 35 | ClipEditorTreeView(QWidget *parent = 0); 36 | ~ClipEditorTreeView(); 37 | 38 | protected: 39 | QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers); 40 | 41 | }; 42 | 43 | #endif // CLIPEDITORTREEVIEW_H 44 | -------------------------------------------------------------------------------- /FocusSelectLineEdit.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2019 Kevin B. Hendricks, Stratford Ontario Canada 4 | ** 5 | ** This file is part of PageEdit. 6 | ** 7 | ** PageEdit is free software: you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation, either version 3 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** PageEdit is distributed in the hope that it will be useful, 13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ** GNU General Public License for more details. 16 | ** 17 | ** You should have received a copy of the GNU General Public License 18 | ** along with PageEdit. If not, see . 19 | ** 20 | *************************************************************************/ 21 | 22 | /* ============================================================ 23 | * QupZilla - modified version of focusselectlineedit.cpp 24 | * Copyright (C) 2010-2014 David Rosca 25 | * GPL 3 26 | * ============================================================ */ 27 | 28 | 29 | #include 30 | #include "FocusSelectLineEdit.h" 31 | 32 | FocusSelectLineEdit::FocusSelectLineEdit(QWidget* parent) 33 | : QLineEdit(parent) 34 | , m_mouseFocusReason(false) 35 | { 36 | } 37 | 38 | void FocusSelectLineEdit::setFocus() 39 | { 40 | selectAll(); 41 | 42 | QLineEdit::setFocus(); 43 | } 44 | 45 | void FocusSelectLineEdit::focusInEvent(QFocusEvent* event) 46 | { 47 | m_mouseFocusReason = event->reason() == Qt::MouseFocusReason; 48 | selectAll(); 49 | 50 | QLineEdit::focusInEvent(event); 51 | } 52 | 53 | void FocusSelectLineEdit::mousePressEvent(QMouseEvent* event) 54 | { 55 | if (m_mouseFocusReason) { 56 | m_mouseFocusReason = false; 57 | return; 58 | } 59 | 60 | QLineEdit::mousePressEvent(event); 61 | } 62 | -------------------------------------------------------------------------------- /FocusSelectLineEdit.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2019 Kevin B. Hendricks, Stratford Ontario Canada 4 | ** 5 | ** This file is part of PageEdit. 6 | ** 7 | ** PageEdit is free software: you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation, either version 3 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** PageEdit is distributed in the hope that it will be useful, 13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ** GNU General Public License for more details. 16 | ** 17 | ** You should have received a copy of the GNU General Public License 18 | ** along with PageEdit. If not, see . 19 | ** 20 | *************************************************************************/ 21 | 22 | /* ============================================================ 23 | * QupZilla - modified version of focusselectlineedit.h 24 | * Copyright (C) 2010-2014 David Rosca 25 | * GPL 3 26 | * ============================================================ */ 27 | 28 | #ifndef FOCUSSELECTLINEEDIT_H 29 | #define FOCUSSELECTLINEEDIT_H 30 | 31 | #include 32 | 33 | class FocusSelectLineEdit : public QLineEdit 34 | { 35 | Q_OBJECT 36 | public: 37 | explicit FocusSelectLineEdit(QWidget* parent = 0); 38 | 39 | public slots: 40 | void setFocus(); 41 | 42 | protected: 43 | void focusInEvent(QFocusEvent* event); 44 | void mousePressEvent(QMouseEvent* event); 45 | 46 | bool m_mouseFocusReason; 47 | 48 | }; 49 | 50 | #endif // FOCUSSELECTLINEEDIT_H 51 | -------------------------------------------------------------------------------- /GeneralSettings.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2019-2022 Kevin B. Hendricks, Stratford Ontario Canada 4 | ** Copyright (C) 2011 John Schember 5 | ** 6 | ** This file is part of PageEdit. 7 | ** 8 | ** PageEdit is free software: you can redistribute it and/or modify 9 | ** it under the terms of the GNU General Public License as published by 10 | ** the Free Software Foundation, either version 3 of the License, or 11 | ** (at your option) any later version. 12 | ** 13 | ** PageEdit is distributed in the hope that it will be useful, 14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ** GNU General Public License for more details. 17 | ** 18 | ** You should have received a copy of the GNU General Public License 19 | ** along with PageEdit. If not, see . 20 | ** 21 | *************************************************************************/ 22 | 23 | #pragma once 24 | #ifndef GENERALSETTINGS_H 25 | #define GENERALSETTINGS_H 26 | 27 | #include "PreferencesWidget.h" 28 | #include "ui_PGeneralSettings.h" 29 | 30 | 31 | /** 32 | * Preferences widget for general preferences. 33 | */ 34 | class GeneralSettings : public PreferencesWidget 35 | { 36 | public: 37 | GeneralSettings(); 38 | PreferencesWidget::ResultActions saveSettings(); 39 | 40 | private: 41 | void readSettings(); 42 | 43 | QString m_UILanguage; 44 | 45 | bool m_disable_gpu; 46 | Ui::GeneralSettings ui; 47 | }; 48 | 49 | #endif // GENERALSETTINGS_H 50 | -------------------------------------------------------------------------------- /HTMLEncodingResolver.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2016-2024 Kevin B. Hendricks, Stratford Ontario Canada 4 | ** Copyright (C) 2009-2011 Strahinja Markovic 5 | ** 6 | ** This file is part of PageEdit. 7 | ** 8 | ** PageEdit is free software: you can redistribute it and/or modify 9 | ** it under the terms of the GNU General Public License as published by 10 | ** the Free Software Foundation, either version 3 of the License, or 11 | ** (at your option) any later version. 12 | ** 13 | ** PageEdit is distributed in the hope that it will be useful, 14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ** GNU General Public License for more details. 17 | ** 18 | ** You should have received a copy of the GNU General Public License 19 | ** along with PageEdit. If not, see . 20 | ** 21 | *************************************************************************/ 22 | 23 | #pragma once 24 | #ifndef HTMLEncodingResolver_H 25 | #define HTMLEncodingResolver_H 26 | 27 | #include 28 | 29 | class QString; 30 | 31 | class HTMLEncodingResolver 32 | { 33 | 34 | public: 35 | 36 | // Accepts a full path to an HTML file. 37 | // Reads the file, detects the encoding 38 | // and returns the text converted to Unicode. 39 | static QString ReadHTMLFile(const QString &fullfilepath); 40 | 41 | private: 42 | 43 | // Accepts an HTML stream and tries to determine its encoding; 44 | // if no encoding is detected, the default codec for this locale is returned. 45 | // We use this function because Qt's QTextCodec::codecForHtml() function 46 | // leaves a *lot* to be desired. 47 | static QStringDecoder GetDecoderForHTML(const QByteArray &raw_text); 48 | 49 | // This function goes through the entire byte array 50 | // and tries to see whether this is a valid UTF-8 sequence. 51 | // If it's valid, this is probably a UTF-8 string. 52 | static bool IsValidUtf8(const QByteArray &string); 53 | 54 | static QByteArray FixupCodePageMapping(const QByteArray& ba); 55 | }; 56 | 57 | 58 | #endif // HTMLEncodingResolver_H 59 | -------------------------------------------------------------------------------- /MainApplication.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2019-2024 Kevin B. Hendricks, Stratford, Ontario Canada 4 | ** Copyright (C) 2019-2024 Doug Massay 5 | ** Copyright (C) 2012 John Schember 6 | ** Copyright (C) 2012 Grant Drake 7 | ** Copyright (C) 2012 Dave Heiland 8 | ** 9 | ** This file is part of PageEdit. 10 | ** 11 | ** PageEdit is free software: you can redistribute it and/or modify 12 | ** it under the terms of the GNU General Public License as published by 13 | ** the Free Software Foundation, either version 3 of the License, or 14 | ** (at your option) any later version. 15 | ** 16 | ** PageEdit is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | ** GNU General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU General Public License 22 | ** along with PageEdit. If not, see . 23 | ** 24 | *************************************************************************/ 25 | 26 | #pragma once 27 | #ifndef MAINAPPLICATION_H 28 | #define MAINAPPLICATION_H 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | class QTimer; 35 | 36 | class MainApplication : public QApplication 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | MainApplication(int &argc, char **argv); 42 | 43 | bool isDarkMode() { return m_isDark; } 44 | bool AlwaysUseNFC(){ return m_AlwaysUseNFC; }; 45 | 46 | signals: 47 | void applicationActivated(); 48 | void applicationDeactivated(); 49 | void applicationPaletteChanged(); 50 | 51 | public slots: 52 | void EmitPaletteChanged(); 53 | void systemColorChanged(); 54 | 55 | protected: 56 | bool event(QEvent *pEvent); 57 | 58 | private: 59 | void windowsDarkThemeChange(); 60 | void windowsLightThemeChange(); 61 | bool m_isDark; 62 | QTimer * m_PaletteChangeTimer; 63 | bool m_AlwaysUseNFC = true; 64 | bool m_UseAppPaletteEvent = false; 65 | }; 66 | 67 | #endif // MAINAPPLICATION_H 68 | 69 | 70 | -------------------------------------------------------------------------------- /OPFReader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef OPFREADER_H 3 | #define OPFREADER_H 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | class QXmlStreamReader; 11 | class QDir; 12 | 13 | class OPFReader : QObject 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | 19 | OPFReader(); 20 | ~OPFReader() { }; 21 | 22 | void parseOPF(const QString& opfpath); 23 | QStringList GetSpineFilePathList(); 24 | QStringList GetAudioFilePathList(); 25 | QStringList GetVideoFilePathList(); 26 | QStringList GetImageFilePathList(); 27 | QStringList GetSVGFilePathList(); 28 | QStringList GetCSSFilePathList(); 29 | QStringList GetManifestFilePathList(); 30 | 31 | protected: 32 | 33 | void ReadManifestItemElement(QXmlStreamReader *opf_reader); 34 | void ReadSpineItemRef(QXmlStreamReader *opf_reader); 35 | 36 | private: 37 | 38 | QDir m_opfDir; 39 | QStringList m_ManifestFilePaths; 40 | QMap m_IDMap; 41 | QMap m_FileMimeTypes; 42 | QStringList m_SpineFilePaths; 43 | QString m_opfpath; 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /PEDarkStyle.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2020 Doug Massay 4 | ** 5 | ** This file is part of Sigil. 6 | ** 7 | ** Sigil is free software: you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation, either version 3 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** Sigil is distributed in the hope that it will be useful, 13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ** GNU General Public License for more details. 16 | ** 17 | ** You should have received a copy of the GNU General Public License 18 | ** along with Sigil. If not, see . 19 | ** 20 | *************************************************************************/ 21 | 22 | #pragma once 23 | #ifndef PEDARKSTYLE_H 24 | #define PEDARKSTYLE_H 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | class PEDarkStyle : public QProxyStyle { 32 | Q_OBJECT 33 | 34 | public: 35 | PEDarkStyle(); 36 | explicit PEDarkStyle(QStyle *style); 37 | 38 | QStyle *baseStyle() const; 39 | 40 | void polish(QPalette &palette) override; 41 | void polish(QApplication *app) override; 42 | 43 | private: 44 | QStyle *styleBase(QStyle *style = Q_NULLPTR) const; 45 | }; 46 | 47 | #endif // PEDARKSTYLE_H 48 | 49 | -------------------------------------------------------------------------------- /PreferencesWidget.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2019-2020 Kevin B. Hendricks, Stratford Ontario Canada 4 | ** Copyright (C) 2011 John Schember 5 | ** 6 | ** This file is part of PageEdit. 7 | ** 8 | ** PageEdit is free software: you can redistribute it and/or modify 9 | ** it under the terms of the GNU General Public License as published by 10 | ** the Free Software Foundation, either version 3 of the License, or 11 | ** (at your option) any later version. 12 | ** 13 | ** PageEdit is distributed in the hope that it will be useful, 14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ** GNU General Public License for more details. 17 | ** 18 | ** You should have received a copy of the GNU General Public License 19 | ** along with PageEdit. If not, see . 20 | ** 21 | *************************************************************************/ 22 | 23 | #pragma once 24 | #ifndef PREFERENCESWIDGET_H 25 | #define PREFERENCESWIDGET_H 26 | 27 | #include 28 | 29 | class QString; 30 | 31 | /** 32 | * Base Interface for preferences widgets. 33 | */ 34 | class PreferencesWidget : public QWidget 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | typedef uint32_t ResultActions; 40 | /** 41 | * Describes the result actions to present to the user as a result 42 | * of saving any changes made in the preferences widgets. 43 | * Results values of powers of 2 flags 44 | */ 45 | enum ResultAction { 46 | ResultAction_None = 0, // Default, no further action required 47 | ResultAction_RestartPageEdit = 1, // Warn user that PageEdit needs to be restarted. 48 | ResultAction_ReloadPreview = 2, // Reload main Preview/PageEdit widget 49 | ResultAction_Mask = 3, // And Mask of allowable values 50 | }; 51 | 52 | /** 53 | * Save settings made available by the widget. 54 | */ 55 | virtual ResultActions saveSettings() = 0; 56 | }; 57 | 58 | #endif // PREFERENCESWIDGET_H 59 | -------------------------------------------------------------------------------- /QuickParser.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2020-2024 Kevin B. Hendricks Stratford, ON, Canada 4 | ** 5 | ** This file is part of PageEdit. 6 | ** 7 | ** PageEdit is free software: you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation, either version 3 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** PageEdit is distributed in the hope that it will be useful, 13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ** GNU General Public License for more details. 16 | ** 17 | ** You should have received a copy of the GNU General Public License 18 | ** along with PageEdit. If not, see . 19 | ** 20 | *************************************************************************/ 21 | 22 | #ifndef QUICK_PARSER 23 | #define QUICK_PARSER 24 | 25 | #include 26 | #include 27 | 28 | #include "TagAtts.h" 29 | 30 | class TagAtts; 31 | class QString; 32 | 33 | class QuickParser 34 | { 35 | public: 36 | 37 | struct MarkupInfo { 38 | int pos; 39 | QString text; 40 | QString lang; 41 | QString tpath; 42 | QString tname; 43 | QString ttype; 44 | TagAtts tattr; 45 | }; 46 | 47 | QuickParser(const QString &source, const QString default_lang = "en"); 48 | ~QuickParser() {}; 49 | void reload_parser(const QString &source, const QString default_lang = "en"); 50 | MarkupInfo parse_next(); 51 | QString serialize_markup(const MarkupInfo &mi); 52 | 53 | private: 54 | QStringView parseML(); 55 | void parseTag(const QStringView tagstring, MarkupInfo &mi); 56 | int findTarget(const QString &tgt, int p, bool after=false); 57 | int skipAnyBlanks(const QStringView segment, int p); 58 | int stopWhenContains(const QStringView segment, const QString& stopchars, int p); 59 | 60 | QString m_source; 61 | int m_pos; 62 | int m_next; 63 | QStringList m_TagPath; 64 | QStringList m_LangPath; 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /SearchToolbar.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2019-2024 Kevin B. Hendricks, Stratford Ontario Canada 4 | ** 5 | ** This file is part of PageEdit. 6 | ** 7 | ** PageEdit is free software: you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation, either version 3 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** PageEdit is distributed in the hope that it will be useful, 13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ** GNU General Public License for more details. 16 | ** 17 | ** You should have received a copy of the GNU General Public License 18 | ** along with PageEdit. If not, see . 19 | ** 20 | *************************************************************************/ 21 | 22 | /* ============================================================ 23 | * QupZilla - modified version of searchtoolbar.h 24 | * Copyright (C) 2010-2017 David Rosca 25 | * GPL 3 26 | * ============================================================= */ 27 | 28 | #ifndef SEARCHTOOLBAR_H 29 | #define SEARCHTOOLBAR_H 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | namespace Ui 36 | { 37 | class SearchToolbar; 38 | } 39 | 40 | class QLineEdit; 41 | 42 | class WebViewEdit; 43 | 44 | class SearchToolbar : public QWidget 45 | { 46 | Q_OBJECT 47 | public: 48 | explicit SearchToolbar(WebViewEdit* view, QWidget* parent = 0); 49 | ~SearchToolbar(); 50 | 51 | QString getNeedle(); 52 | void focusSearchLine(); 53 | bool eventFilter(QObject* obj, QEvent* event); 54 | 55 | public Q_SLOTS: 56 | void setText(const QString &text); 57 | void searchText(const QString &text); 58 | void updateFindFlags(); 59 | void caseSensitivityChanged(); 60 | 61 | void findNext(); 62 | void findPrevious(); 63 | 64 | void close(); 65 | 66 | private: 67 | Ui::SearchToolbar* ui; 68 | WebViewEdit* m_view; 69 | 70 | QWebEnginePage::FindFlags m_findFlags; 71 | }; 72 | 73 | #endif // SEARCHTOOLBAR_H 74 | -------------------------------------------------------------------------------- /SelectCharacter.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2019 Kevin B. Hendricks, Stratford, Otario Canada 4 | ** Copyright (C) 2012 John Schember 5 | ** Copyright (C) 2012 Dave Heiland 6 | ** 7 | ** This file is part of PageEdit. 8 | ** 9 | ** PageEdit is free software: you can redistribute it and/or modify 10 | ** it under the terms of the GNU General Public License as published by 11 | ** the Free Software Foundation, either version 3 of the License, or 12 | ** (at your option) any later version. 13 | ** 14 | ** PageEdit is distributed in the hope that it will be useful, 15 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | ** GNU General Public License for more details. 18 | ** 19 | ** You should have received a copy of the GNU General Public License 20 | ** along with PageEdit. If not, see . 21 | ** 22 | *************************************************************************/ 23 | 24 | #pragma once 25 | #ifndef SELECTCHARACTER_H 26 | #define SELECTCHARACTER_H 27 | 28 | #include 29 | 30 | #include "SettingsStore.h" 31 | #include "ui_SelectCharacter.h" 32 | 33 | class QGridLayout; 34 | class QSignalMapper; 35 | 36 | class SelectCharacter: public QDialog 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | SelectCharacter(QWidget *parent = 0); 42 | ~SelectCharacter(); 43 | 44 | void SetList(); 45 | 46 | QString Selection(); 47 | 48 | public slots: 49 | void show(); 50 | 51 | signals: 52 | void SelectedCharacter(const QString &text); 53 | 54 | private slots: 55 | void WriteSettings(); 56 | void SetSelectedCharacter(const QString &text); 57 | 58 | private: 59 | 60 | void AddGrid(const QStringList &characters, int width); 61 | void ReadSettings(); 62 | void connectSignalsSlots(); 63 | 64 | QString m_SelectedText; 65 | 66 | QSignalMapper *m_buttonMapper; 67 | SettingsStore::SpecialCharacterAppearance m_SpecialCharacterAppearance; 68 | 69 | Ui::SelectCharacter ui; 70 | }; 71 | 72 | #endif // SELECTCHARACTER_H 73 | -------------------------------------------------------------------------------- /SelectCharacter.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | SelectCharacter 4 | 5 | 6 | 7 | 0 8 | 0 9 | 355 10 | 96 11 | 12 | 13 | 14 | Insert Special Character 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /SelectId.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2015-2019 Kevin B. Hendricks, Stratford Ontario Canada 4 | ** Copyright (C) 2012 John Schember 5 | ** Copyright (C) 2012 Dave Heiland 6 | ** 7 | ** This file is part of PageEdit. 8 | ** 9 | ** PageEdit is free software: you can redistribute it and/or modify 10 | ** it under the terms of the GNU General Public License as published by 11 | ** the Free Software Foundation, either version 3 of the License, or 12 | ** (at your option) any later version. 13 | ** 14 | ** PageEdit is distributed in the hope that it will be useful, 15 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | ** GNU General Public License for more details. 18 | ** 19 | ** You should have received a copy of the GNU General Public License 20 | ** along with PageEdit. If not, see . 21 | ** 22 | *************************************************************************/ 23 | 24 | #pragma once 25 | #ifndef SELECTID_H 26 | #define SELECTID_H 27 | 28 | #include 29 | 30 | #include "ui_SelectId.h" 31 | 32 | class SelectId: public QDialog 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | SelectId(QString id, QString &source, QWidget *parent = 0); 38 | 39 | void SetList(); 40 | 41 | QString GetId(); 42 | 43 | private slots: 44 | void WriteSettings(); 45 | 46 | private: 47 | void SetSelectedText(); 48 | 49 | void ReadSettings(); 50 | void connectSignalsSlots(); 51 | 52 | QString m_SelectedText; 53 | 54 | QString m_CurrentSource; 55 | 56 | Ui::SelectId ui; 57 | }; 58 | 59 | #endif // SELECTID_H 60 | -------------------------------------------------------------------------------- /SimplePage.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2019-2024 Kevin B. Hendricks, Stratford Ontario Canada 4 | ** 5 | ** This file is part of PageEdit. 6 | ** 7 | ** PageEdit is free software: you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation, either version 3 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** PageEdit is distributed in the hope that it will be useful, 13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ** GNU General Public License for more details. 16 | ** 17 | ** You should have received a copy of the GNU General Public License 18 | ** along with PageEdit. If not, see . 19 | ** 20 | *************************************************************************/ 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include "Utility.h" 28 | #include "SimplePage.h" 29 | 30 | 31 | SimplePage::SimplePage(QWebEngineProfile* profile, QObject *parent) 32 | : QWebEnginePage(profile, parent) 33 | { 34 | setBackgroundColor(Utility::WebViewBackgroundColor()); 35 | setUrl(QUrl("about:blank")); 36 | } 37 | -------------------------------------------------------------------------------- /SimplePage.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2019-2023 Kevin B. Hendricks, Stratford Ontario Canada 4 | ** 5 | ** This file is part of PageEdit. 6 | ** 7 | ** PageEdit is free software: you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation, either version 3 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** PageEdit is distributed in the hope that it will be useful, 13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ** GNU General Public License for more details. 16 | ** 17 | ** You should have received a copy of the GNU General Public License 18 | ** along with PageEdit. If not, see . 19 | ** 20 | *************************************************************************/ 21 | 22 | #pragma once 23 | #ifndef SIMPLEPAGE_H 24 | #define SIMPLEPAGE_H 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | class QWebEngineProfile; 33 | 34 | class SimplePage : public QWebEnginePage 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | SimplePage(QWebEngineProfile *profile, QObject *parent = 0); 40 | 41 | }; 42 | 43 | #endif // SIMPLEPAGE_H 44 | -------------------------------------------------------------------------------- /UIDictionary.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2019 Kevin B. Hendricks, Stratford, Ontario, Canada 4 | ** 5 | ** This file is part of PageEdit. 6 | ** 7 | ** PageEdit is free software: you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation, either version 3 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** PageEdit is distributed in the hope that it will be useful, 13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ** GNU General Public License for more details. 16 | ** 17 | ** You should have received a copy of the GNU General Public License 18 | ** along with PageEdit. If not, see . 19 | ** 20 | *************************************************************************/ 21 | 22 | #pragma once 23 | #ifndef UIDICTIONARY_H 24 | #define UIDICTIONARY_H 25 | 26 | #include 27 | class QString; 28 | 29 | class UIDictionary 30 | { 31 | 32 | public: 33 | 34 | static QString GetDictionaryPath(); 35 | 36 | static QStringList GetUIDictionaries(); 37 | }; 38 | 39 | #endif // UIDICTIONARY_H 40 | -------------------------------------------------------------------------------- /UILanguage.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2019 Kevin B. Hendricks, Stratford, Ontario, Canada 4 | ** Copyright (C) 2011 John Schember 5 | ** 6 | ** This file is part of PageEdit. 7 | ** 8 | ** PageEdit is free software: you can redistribute it and/or modify 9 | ** it under the terms of the GNU General Public License as published by 10 | ** the Free Software Foundation, either version 3 of the License, or 11 | ** (at your option) any later version. 12 | ** 13 | ** PageEdit is distributed in the hope that it will be useful, 14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ** GNU General Public License for more details. 17 | ** 18 | ** You should have received a copy of the GNU General Public License 19 | ** along with PageEdit. If not, see . 20 | ** 21 | *************************************************************************/ 22 | 23 | #pragma once 24 | #ifndef UILANGUAGE_H 25 | #define UILANGUAGE_H 26 | 27 | #include 28 | 29 | class UILanguage 30 | { 31 | 32 | public: 33 | 34 | static QStringList GetPossibleTranslationPaths(); 35 | 36 | static QStringList GetUILanguages(); 37 | }; 38 | 39 | #endif // UILANGUAGE_H 40 | -------------------------------------------------------------------------------- /URLInterceptor.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2020 Kevin B. Hendricks, Stratford, Ontario, Canada 4 | ** 5 | ** This file is part of PageEdit. 6 | ** 7 | ** PageEdit is free software: you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation, either version 3 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** PageEdit is distributed in the hope that it will be useful, 13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ** GNU General Public License for more details. 16 | ** 17 | ** You should have received a copy of the GNU General Public License 18 | ** along with PageEdit. If not, see . 19 | ** 20 | *************************************************************************/ 21 | #pragma once 22 | #ifndef URLINTERCEPTOR_H 23 | #define URLINTERCEPTOR_H 24 | 25 | #include 26 | 27 | class URLInterceptor : public QWebEngineUrlRequestInterceptor 28 | { 29 | public: 30 | explicit URLInterceptor(QObject* parent = Q_NULLPTR); 31 | 32 | void interceptRequest(QWebEngineUrlRequestInfo &info) Q_DECL_OVERRIDE; 33 | 34 | }; 35 | 36 | #endif // URLINTERCEPTOR_H 37 | -------------------------------------------------------------------------------- /WebPageEdit.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2019-2023 Kevin B. Hendricks, Stratford, Ontario Canada 4 | ** 5 | ** This file is part of PageEdit. 6 | ** 7 | ** PageEdit is free software: you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation, either version 3 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** PageEdit is distributed in the hope that it will be useful, 13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ** GNU General Public License for more details. 16 | ** 17 | ** You should have received a copy of the GNU General Public License 18 | ** along with PageEdit. If not, see . 19 | ** 20 | *************************************************************************/ 21 | 22 | #pragma once 23 | #ifndef WEBPAGEEDIT_H 24 | #define WEBPAGEEDIT_H 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | class QWebEngineProfile; 33 | 34 | class WebPageEdit : public QWebEnginePage 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | WebPageEdit(QWebEngineProfile *profile, QObject *parent = 0); 40 | 41 | bool acceptNavigationRequest(const QUrl & url, QWebEnginePage::NavigationType ntype, bool isMainFrame); 42 | void javaScriptConsoleMessage(QWebEnginePage::JavaScriptConsoleMessageLevel level, 43 | const QString & message, int lineNumber, const QString & sourceID); 44 | 45 | signals: 46 | void LinkClicked(const QUrl &url); 47 | 48 | private slots: 49 | void EmitLinkClicked(); 50 | 51 | private: 52 | QUrl m_url; 53 | }; 54 | 55 | #endif // WEBPAGEEDIT_H 56 | 57 | -------------------------------------------------------------------------------- /WebProfileMgr.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2023-2025 Kevin B. Hendricks, Stratford, ON, Canada 4 | ** 5 | ** This file is part of PageEdit. 6 | ** 7 | ** PageEdit is free software: you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation, either version 3 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** PageEdit is distributed in the hope that it will be useful, 13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ** GNU General Public License for more details. 16 | ** 17 | ** You should have received a copy of the GNU General Public License 18 | ** along with PageEdit. If not, see . 19 | ** 20 | *************************************************************************/ 21 | 22 | #pragma once 23 | #ifndef WEBPROFILEMGR_H 24 | #define WEBPROFILEMGR_H 25 | 26 | #include 27 | 28 | /** 29 | * Singleton. 30 | * 31 | * WebProfileMgr 32 | */ 33 | 34 | class URLInterceptor; 35 | class QWebEngineProfile; 36 | 37 | class WebProfileMgr 38 | { 39 | 40 | public: 41 | 42 | static WebProfileMgr *instance(); 43 | QWebEngineProfile* GetPreviewProfile(); 44 | QWebEngineProfile* GetOneTimeProfile(); 45 | 46 | private: 47 | 48 | WebProfileMgr(); 49 | void InitializeDefaultSettings(QWebEngineSettings* web_settings); 50 | URLInterceptor* m_URLint; 51 | 52 | QWebEngineProfile* m_preview_profile; 53 | QWebEngineProfile* m_onetime_profile; 54 | static WebProfileMgr *m_instance; 55 | }; 56 | 57 | #endif // WEBPROFILEMGR_H 58 | -------------------------------------------------------------------------------- /Zoomable.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** 3 | ** Copyright (C) 2019 Kevin B. Hendricks, Stratford, Ontario, Canada 4 | ** Copyright (C) 2009, 2010, 2011 Strahinja Markovic 5 | ** 6 | ** This file is part of PageEdit. 7 | ** 8 | ** PageEdit is free software: you can redistribute it and/or modify 9 | ** it under the terms of the GNU General Public License as published by 10 | ** the Free Software Foundation, either version 3 of the License, or 11 | ** (at your option) any later version. 12 | ** 13 | ** PageEdit is distributed in the hope that it will be useful, 14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ** GNU General Public License for more details. 17 | ** 18 | ** You should have received a copy of the GNU General Public License 19 | ** along with PageEdit. If not, see . 20 | ** 21 | *************************************************************************/ 22 | 23 | #pragma once 24 | #ifndef ZOOMABLE_H 25 | #define ZOOMABLE_H 26 | 27 | /** 28 | * An interface for widgets that can be zoomed. 29 | */ 30 | class Zoomable 31 | { 32 | 33 | public: 34 | 35 | /** 36 | * Sets a zoom factor for the view. 37 | * Thus, zooms in (factor > 1.0) or out (factor < 1.0). 38 | * 39 | * @param factor The zoom factor to use. 40 | */ 41 | virtual void SetZoomFactor(float factor) = 0; 42 | 43 | /** 44 | * Returns the widget's current zoom factor. 45 | * 46 | * @return The current zoom factor. 47 | */ 48 | virtual float GetZoomFactor() const = 0; 49 | }; 50 | 51 | #endif // ZOOMABLE_H 52 | -------------------------------------------------------------------------------- /ci_scripts/winget/Sigil-Ebook.PageEdit.installer.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.9.0.schema.json 2 | 3 | PackageIdentifier: Sigil-Ebook.PageEdit 4 | PackageVersion: 5 | Platform: 6 | - Windows.Desktop 7 | MinimumOSVersion: 10.0.17763.0 8 | InstallerType: inno 9 | Scope: machine 10 | InstallModes: 11 | - interactive 12 | - silent 13 | - silentWithProgress 14 | InstallerSwitches: 15 | Upgrade: /NORESTART /SUPPRESSMSGBOXES /COMPONENTS="dicon" 16 | UpgradeBehavior: install 17 | FileExtensions: 18 | - xhtml 19 | - opf 20 | Dependencies: 21 | PackageDependencies: 22 | - PackageIdentifier: Microsoft.VCRedist.2015+.x64 23 | Commands: 24 | - pageedit 25 | Installers: 26 | - Architecture: x64 27 | ElevationRequirement: elevatesSelf 28 | InstallerUrl: https://github.com/Sigil-Ebook/PageEdit/releases/download//PageEdit--Windows-x64-Setup.exe 29 | InstallerSha256: 30 | InstallerSwitches: 31 | Custom: /ALLUSERS /NORESTART /SUPPRESSMSGBOXES /COMPONENTS="dicon" 32 | ReleaseDate: 33 | ManifestType: installer 34 | ManifestVersion: 1.9.0 35 | -------------------------------------------------------------------------------- /ci_scripts/winget/Sigil-Ebook.PageEdit.locale.en-US.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.9.0.schema.json 2 | 3 | PackageIdentifier: Sigil-Ebook.PageEdit 4 | PackageVersion: 5 | PackageLocale: en-US 6 | Publisher: Sigil-Ebook 7 | PublisherUrl: https://sigil-ebook.com 8 | PublisherSupportUrl: https://github.com/Sigil-Ebook/PageEdit/issues 9 | # PrivacyUrl: 10 | # Author: 11 | PackageName: PageEdit 12 | # PackageUrl: 13 | License: GNU General Public License v3.0 14 | LicenseUrl: https://raw.githubusercontent.com/Sigil-Ebook/PageEdit/master/COPYING.txt 15 | # Copyright: 16 | CopyrightUrl: https://raw.githubusercontent.com/Sigil-Ebook/PageEdit/master/COPYING.txt 17 | ReleaseNotesUrl: https://github.com/Sigil-Ebook/PageEdit/releases/tag/ 18 | ShortDescription: An ePub visual XHTML editor based on Sigil's Deprecated BookView. It uses WebEngine instead of WebKit. 19 | # Description: 20 | Moniker: pageedit 21 | Tags: 22 | - ebook 23 | - e-book 24 | - ebook-editor 25 | - epub 26 | # ReleaseNotes: 27 | # PurchaseUrl: 28 | # InstallationNotes: 29 | # Documentations: 30 | ManifestType: defaultLocale 31 | ManifestVersion: 1.9.0 32 | -------------------------------------------------------------------------------- /ci_scripts/winget/Sigil-Ebook.PageEdit.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.9.0.schema.json 2 | 3 | PackageIdentifier: Sigil-Ebook.PageEdit 4 | PackageVersion: 5 | DefaultLocale: en-US 6 | ManifestType: version 7 | ManifestVersion: 1.9.0 8 | -------------------------------------------------------------------------------- /ci_scripts/winget/build.ps1: -------------------------------------------------------------------------------- 1 | Param 2 | ( 3 | [parameter(Mandatory = $true)] 4 | [string] $Version 5 | ) 6 | 7 | function Write-MetaData { 8 | param ( 9 | [parameter(Mandatory = $true)] 10 | [string] 11 | $FileName, 12 | [parameter(Mandatory = $true)] 13 | [string] 14 | $Version, 15 | [parameter(Mandatory = $true)] 16 | [string] 17 | $HashAmd64 18 | ) 19 | $content = Get-Content $FileName -Raw 20 | $content = $content.Replace('', $Version) 21 | $content = $content.Replace('', $HashAmd64) 22 | $date = Get-Date -Format "yyyy-MM-dd" 23 | $content = $content.Replace('', $date) 24 | $content | Out-File -Encoding 'UTF8' "./$Version/$FileName" 25 | } 26 | 27 | New-Item -Path $PWD -Name $Version -ItemType "directory" 28 | 29 | # Get hash for installers 30 | Invoke-WebRequest "https://github.com/Sigil-Ebook/PageEdit/releases/download/$Version/PageEdit-$Version-Windows-x64-Setup.exe" -OutFile 'INSTALLER-AMD64.exe' 31 | $HashAmd64 = (Get-FileHash -Path 'INSTALLER-AMD64.exe' -Algorithm SHA256).Hash 32 | 33 | # Update the metadata for the files 34 | Get-ChildItem '*.yaml' | ForEach-Object -Process { 35 | Write-MetaData -FileName $_.Name -Version $Version -HashAmd64 $HashAmd64 36 | } 37 | if (-not $env:WINGET_TOKEN) { 38 | Write-Error "You must set the WINGET_TOKEN environment variable to create a pull request." 39 | Exit 1 40 | } 41 | # Get the latest wingetcreate exe 42 | Invoke-WebRequest 'https://aka.ms/wingetcreate/preview' -OutFile wingetcreate.exe 43 | 44 | $prtitle = "New Version: Sigil-Ebook.PageEdit version $Version" 45 | 46 | # Create the PR 47 | ./wingetcreate.exe submit --prtitle $prtitle --token $env:WINGET_TOKEN $Version 48 | -------------------------------------------------------------------------------- /dark/close-hover.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dark/closetab-hover.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dark/closetab-mini.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dark/closetab-pressed.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dark/dark.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | closetab-hover.svg 4 | closetab-mini.svg 5 | closetab-pressed.svg 6 | dock-close.svg 7 | dock-close-hover.svg 8 | undock.svg 9 | undock-hover.svg 10 | win-dark-style.qss 11 | lin_dark_scrollbar.css 12 | win_dark_scrollbar.css 13 | mac_dark_scrollbar.css 14 | 15 | 16 | -------------------------------------------------------------------------------- /dark/dock-close-hover.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dark/dock-close.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dark/mac_dark_scrollbar.css: -------------------------------------------------------------------------------- 1 | a:link { 2 | color: #ff9999; 3 | } 4 | 5 | a:visited { 6 | color: #99ff99; 7 | } 8 | 9 | ::-webkit-scrollbar { 10 | width: 16px; 11 | } 12 | 13 | ::-webkit-scrollbar-track { 14 | background: rgb(61,61,61); 15 | } 16 | 17 | ::-webkit-scrollbar-thumb { 18 | background: rgb(119, 119, 119); 19 | border: 4px solid transparent; 20 | border-radius: 10px; 21 | background-clip: content-box; 22 | } 23 | 24 | ::-webkit-scrollbar-corner { 25 | background: rgb(61,61,61); 26 | } 27 | 28 | ::-webkit-scrollbar {display: block;} 29 | -------------------------------------------------------------------------------- /dark/undock-hover.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dark/undock.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dark/win-dark-style.qss: -------------------------------------------------------------------------------- 1 | QToolBar { 2 | border: 0; 3 | } 4 | 5 | QToolTip { 6 | background-color: rgb(42, 42, 42); 7 | color: rgb(238, 238, 238); 8 | border: 1px solid rgb(66, 66, 66); 9 | padding: 2px; 10 | border-radius: 4px; 11 | } 12 | 13 | QMenu::item:disabled { 14 | background: #2d2d2d; 15 | color: #808080; 16 | } 17 | 18 | QTabBar { 19 | qproperty-drawBase:0; 20 | } 21 | 22 | QDockWidget::float-button, QDockWidget::close-button { 23 | border: transparent; 24 | background: transparent; 25 | padding: 0; 26 | } 27 | 28 | QDockWidget { 29 | titlebar-normal-icon: url(:/dark/undock.svg); 30 | titlebar-close-icon: url(':/dark/dock-close.svg'); 31 | } 32 | 33 | QDockWidget::float-button:hover { 34 | image: url(:/dark/undock-hover.svg); 35 | } 36 | 37 | QDockWidget::float-button:hover { 38 | border: none; 39 | } 40 | 41 | QDockWidget::close-button:hover { 42 | image: url(:/dark/dock-close-hover.svg); 43 | } 44 | 45 | QDockWidget::close-button:hover { 46 | border: none; 47 | } 48 | 49 | QTabBar::close-button { 50 | border: 0; 51 | margin: 2px; 52 | padding: 0; 53 | image: url(:/dark/closetab-mini.svg); 54 | } 55 | 56 | QTabBar::close-button:hover { 57 | image: url(:/dark/closetab-hover.svg); 58 | } 59 | 60 | QTabBar::close-button:pressed { 61 | image: url(:/dark/closetab-pressed.svg); 62 | } 63 | -------------------------------------------------------------------------------- /dictionaries/About.txt: -------------------------------------------------------------------------------- 1 | All dictionaries in this directory were downloaded and extracted from the official 2 | libreooffice-dictionaries-5.0.1.2.tar.xz archive available from the website: 3 | https://www.libreoffice.org/download/libreoffice-fresh/ 4 | Downloaded: September 16, 2015 5 | 6 | Author and License are summarized below. For License Details see each dictionaries specific README file: 7 | 8 | de_DE-frami 9 | - Authors: Bjoern Jacke and Franz Michael Baumann 10 | - License: GPL-v3 LGPL-v3+ 11 | 12 | en_GB 13 | - Authors: Kevin Atkinson, David Bartlett, Brian Kelk, Andrew Brown 14 | - License: LGPL 15 | 16 | en_US 17 | - Authors: Kevin Atkinson, Alan Beale, Laslo Nemeth, SCOWL 18 | - License: LGPL and BSD-style license with attribute clause. Please see README_en_US.txt for complete details 19 | 20 | es_ANY 21 | - A complete list of collaborators and maintainer is provided in the README_es_ANY.txt file 22 | - License: GPL, Triple License with MPL 23 | 24 | fr-moderne 25 | - Authors: http://www.dicollecte.org/, See the Principla Contributors in README_fr.txt 26 | - License: MPL-v2.0 GPL-v2 LGPL-v2.1 27 | 28 | hyph_fr 29 | y - http://www.dicollecte.org/ 30 | - License GNU LGPL 31 | -------------------------------------------------------------------------------- /dictionaries/README.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sigil-Ebook/PageEdit/57649924346d29dea29de3d2aa8d6937daefcc57/dictionaries/README.txt -------------------------------------------------------------------------------- /dictionaries/README_de_DE_frami.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sigil-Ebook/PageEdit/57649924346d29dea29de3d2aa8d6937daefcc57/dictionaries/README_de_DE_frami.txt -------------------------------------------------------------------------------- /dictionaries/README_en_GB.txt: -------------------------------------------------------------------------------- 1 | Original version of the en_GB dictionary: 2 | http://www.openoffice.org/issues/show_bug.cgi/id=72145 3 | 4 | OpenOffice.org patch and morphological extension 5 | 6 | The morphological extension based on Wordlist POS and AGID data 7 | created by Kevin Atkinson and released on http://wordlist.sourceforge.net. 8 | 9 | Other fixes: 10 | 11 | OOo Issue 48060 - add numbers with affixes by COMPOUNDRULE (1st, 111th, 1990s etc.) 12 | OOo Issue 29112, 55498 - add NOSUGGEST flags to taboo words 13 | New REP items (better suggestions for accented words and a few mistakes) 14 | OOo Issue 63541 - remove *dessicated 15 | 16 | 2008-12-18 nemeth AT OOo 17 | 18 | Original license: 19 | 20 | This dictionary was initially based on a subset of the 21 | original English wordlist created by Kevin Atkinson for 22 | Pspell and Aspell and thus is covered by his original 23 | LGPL licence. 24 | 25 | It has been extensively updated by David Bartlett, Brian Kelk 26 | and Andrew Brown: 27 | - numerous Americanism have been removed 28 | - numerous American spellings have been corrected 29 | - missing words have been added 30 | - many errors have been corrected 31 | - compound hyphenated words have been added where appropriate 32 | 33 | Valuable inputs to this process were received from many other 34 | people - far too numerous to name. Serious thanks to you all 35 | for your greatly appreciated help. 36 | 37 | This word list is intended to be a good representation of 38 | current modern British English and thus it should be a good 39 | basis for Commonwealth English in most countries of the world 40 | outside North America. 41 | 42 | The affix file has been created completely from scratch 43 | by David Bartlett and Andrew Brown, based on the published 44 | rules for MySpell and is also provided under the LGPL. 45 | 46 | In creating the affix rules an attempt has been made to 47 | reproduce the most general rules for English word 48 | formation, rather than merely use it as a means to 49 | compress the size of the dictionary. It is hoped that this 50 | will facilitate future localisation to other variants of 51 | English. 52 | 53 | Please let David Bartlett know of any 54 | errors that you find. 55 | 56 | The current release is R 1.20, 30/11/2006 57 | -------------------------------------------------------------------------------- /dictionaries/README_en_US.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sigil-Ebook/PageEdit/57649924346d29dea29de3d2aa8d6937daefcc57/dictionaries/README_en_US.txt -------------------------------------------------------------------------------- /dictionaries/README_extension_owner.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sigil-Ebook/PageEdit/57649924346d29dea29de3d2aa8d6937daefcc57/dictionaries/README_extension_owner.txt -------------------------------------------------------------------------------- /dictionaries/README_hyph_de.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sigil-Ebook/PageEdit/57649924346d29dea29de3d2aa8d6937daefcc57/dictionaries/README_hyph_de.txt -------------------------------------------------------------------------------- /dictionaries/README_hyph_en_US.txt: -------------------------------------------------------------------------------- 1 | hyph_en_US.dic - American English hyphenation patterns for OpenOffice.org 2 | 3 | version 2011-10-07 4 | 5 | - remove unnecessary parts for the new Hyphen 2.8.2 6 | 7 | version 2010-03-16 8 | 9 | Changes 10 | 11 | - forbid hyphenation at 1-character distances from dashes (eg. ad=d-on) 12 | and at the dashes (fix for OpenOffice.org 3.2) 13 | - set correct LEFTHYPHENMIN = 2, RIGHTHYPHENMIN = 3 14 | - handle apostrophes (forbid *o'=clock etc.) 15 | - set COMPOUNDLEFTHYPHENMIN, COMPOUNDRIGHTHYPHENMIN values 16 | - UTF-8 encoding 17 | - Unicode ligature support 18 | 19 | License 20 | 21 | BSD-style. Unlimited copying, redistribution and modification of this file 22 | is permitted with this copyright and license information. 23 | 24 | See original license in this file. 25 | 26 | Conversion and modifications by László Németh (nemeth at OOo). 27 | 28 | Based on the plain TeX hyphenation table 29 | (http://tug.ctan.org/text-archive/macros/plain/base/hyphen.tex) and 30 | the TugBoat hyphenation exceptions log in 31 | http://www.ctan.org/tex-archive/info/digests/tugboat/tb0hyf.tex, processed 32 | by the hyphenex.sh script (see in the same directory). 33 | 34 | Originally developed and distributed with the Hyphen hyphenation library, 35 | see http://hunspell.sourceforge.net/ for the source files and the conversion 36 | scripts. 37 | 38 | Licenses 39 | 40 | hyphen.tex: 41 | % The Plain TeX hyphenation tables [NOT TO BE CHANGED IN ANY WAY!] 42 | % Unlimited copying and redistribution of this file are permitted as long 43 | % as this file is not modified. Modifications are permitted, but only if 44 | % the resulting file is not named hyphen.tex. 45 | 46 | output of hyphenex.sh: 47 | % Hyphenation exceptions for US English, based on hyphenation exception 48 | % log articles in TUGboat. 49 | % 50 | % Copyright 2007 TeX Users Group. 51 | % You may freely use, modify and/or distribute this file. 52 | % 53 | % This is an automatically generated file. Do not edit! 54 | % 55 | % Please contact the TUGboat editorial staff 56 | % for corrections and omissions. 57 | 58 | hyph_en_US.txt: 59 | See the previous licenses. 60 | -------------------------------------------------------------------------------- /dictionaries/de_DE.aff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sigil-Ebook/PageEdit/57649924346d29dea29de3d2aa8d6937daefcc57/dictionaries/de_DE.aff -------------------------------------------------------------------------------- /dictionaries/de_DE.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sigil-Ebook/PageEdit/57649924346d29dea29de3d2aa8d6937daefcc57/dictionaries/de_DE.dic -------------------------------------------------------------------------------- /dictionaries/es.aff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sigil-Ebook/PageEdit/57649924346d29dea29de3d2aa8d6937daefcc57/dictionaries/es.aff -------------------------------------------------------------------------------- /dictionaries/es.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sigil-Ebook/PageEdit/57649924346d29dea29de3d2aa8d6937daefcc57/dictionaries/es.dic -------------------------------------------------------------------------------- /dictionaries/hyph_de_DE.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sigil-Ebook/PageEdit/57649924346d29dea29de3d2aa8d6937daefcc57/dictionaries/hyph_de_DE.dic -------------------------------------------------------------------------------- /dictionaries/hyph_es.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sigil-Ebook/PageEdit/57649924346d29dea29de3d2aa8d6937daefcc57/dictionaries/hyph_es.dic -------------------------------------------------------------------------------- /examples/clip_entries.ini: -------------------------------------------------------------------------------- 1 | [clip_entries] 2 | 1\Name=Clips Help 3 | 1\Text=Right click for menu to add groups and entries. Edit or re-order any item. Use right click in editor to select which entry to paste. 4 | 2\Name=Example Clips/p 5 | 2\Text=

\\1

6 | 3\Name=Example Clips/h1 7 | 3\Text=

\\1

8 | 4\Name=Example Clips/h2 9 | 4\Text=

\\1

10 | 5\Name=Example Clips/h3 11 | 5\Text=

\\1

12 | 6\Name=Example Clips/h4 13 | 6\Text=

\\1

14 | 7\Name=Example Clips/h1 class 15 | 7\Text="

\\1

" 16 | 8\Name=Example Clips/B span 17 | 8\Text="\\1" 18 | 9\Name=Example Clips/I span 19 | 9\Text="\\1" 20 | 10\Name=Example Clips/Example span 21 | 10\Text="\\1" 22 | 11\Name=Example Clips/Miscellaneous/Sigil Split Marker 23 | 11\Text="
" 24 | 12\Name=Example Clips/Miscellaneous/hr 25 | 12\Text=
26 | 13\Name=Example Clips/Miscellaneous/br 27 | 13\Text=
28 | 14\Name=Example Clips/Miscellaneous/div 29 | 14\Text=
\\1
30 | size=15 31 | 15\Name=Example Clips/Text/Lorem Ipsum 32 | 15\Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac tellus nunc. Phasellus imperdiet leo metus, et gravida lacus. Donec metus ligula, elementum at pellentesque pellentesque, suscipit ac nunc. Etiam lobortis, massa ac aliquam auctor, augue nisl sagittis urna, at dapibus tellus erat ullamcorper ligula. Praesent orci dui, pulvinar id convallis a, faucibus non mauris. Donec tellus augue, tempus sed facilisis sed, fringilla quis leo. Mauris vulputate, leo ac facilisis vulputate, enim orci interdum augue, in blandit quam turpis quis dui. Morbi dictum luctus velit nec faucibus. Cras vitae tortor purus, ut tincidunt mauris. Sed at velit nisl. Donec eu mauris tortor, interdum condimentum erat. Nam egestas turpis eget nibh laoreet pharetra. Suspendisse a sem eros, ut pulvinar enim. In sed elit eu nulla accumsan tincidunt eget sit amet ipsum. Nullam ut massa rutrum dolor placerat tempor accumsan eget purus." 33 | -------------------------------------------------------------------------------- /gumbo_subtree/.appveyor.yml: -------------------------------------------------------------------------------- 1 | image: 2 | - Visual Studio 2015 3 | 4 | branches: 5 | only: 6 | - master 7 | 8 | clone_folder: c:\project\gumbo 9 | 10 | configuration: Release 11 | 12 | platform: 13 | - x64 14 | 15 | 16 | only_commits: 17 | files: 18 | - CMakeLists.txt 19 | - .appveyor.yml 20 | - src/ 21 | - python/gumbo/ 22 | 23 | 24 | before_build: 25 | - cmd: |- 26 | mkdir build 27 | cd build 28 | call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PLATFORM% 29 | cmake ..\ -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=%configuration% 30 | 31 | 32 | build_script: 33 | - cmd: |- 34 | call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PLATFORM% 35 | nmake 36 | 37 | 38 | test_script: 39 | - cmd: |- 40 | set PATH=C:\Python37-x64;C:\Python37-x64\Scripts;%PATH% 41 | python --version 42 | pip --version 43 | pip install bs4 44 | cd python\gumbo 45 | python gumboc_test.py 46 | python bs4_adapter_test.py 47 | 48 | -------------------------------------------------------------------------------- /gumbo_subtree/.gitignore: -------------------------------------------------------------------------------- 1 | # Backup files left behind by the Emacs editor. 2 | *~ 3 | 4 | # Lock files used by the Emacs editor. 5 | .\#* 6 | 7 | # emacs auto recovery files from aborted edits 8 | \#*\# 9 | 10 | #use ful for stashing files 11 | *.orig 12 | *.keep 13 | 14 | # Temporary files used by the vim editor. 15 | .*.swp 16 | .swp 17 | 18 | # A hidden file created by the Mac OS X Finder. 19 | .DS_Store 20 | 21 | # Image thumbnail database created by windows 22 | Thumbs.db 23 | 24 | # Various files created by Visual Studio 25 | *.sln 26 | *.suo 27 | *.vcproj 28 | *.user* 29 | #*.rc 30 | *.ncb 31 | *.pch 32 | *.dep 33 | *.idb 34 | *.exp 35 | *.res 36 | *.manifest 37 | *.ilk 38 | *.pdb 39 | *.def 40 | Release 41 | Debug 42 | BuildLog.htm 43 | 44 | # Various files and folders created by CMake 45 | CMakeFiles 46 | CMakeScripts 47 | CMakeCache.txt 48 | *.dir 49 | ALL_BUILD* 50 | 51 | 52 | # Misc files 53 | *.svn 54 | *.a 55 | *.o 56 | *.obj 57 | *.lib 58 | *.exe 59 | *.dll 60 | *.a 61 | *.app 62 | *.xcodeproj 63 | *.pbxbtree 64 | *.pbxindex 65 | *.build 66 | *.smp 67 | *.pl 68 | *.pyc 69 | *.pyo 70 | *.orig 71 | *.bak 72 | *.rar 73 | build 74 | 75 | -------------------------------------------------------------------------------- /gumbo_subtree/.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sigil-Ebook/PageEdit/57649924346d29dea29de3d2aa8d6937daefcc57/gumbo_subtree/.gitmodules -------------------------------------------------------------------------------- /gumbo_subtree/.travis.yml: -------------------------------------------------------------------------------- 1 | language: c++ 2 | 3 | matrix: 4 | include: 5 | - os: linux 6 | dist: trusty 7 | compiler: gcc 8 | - os: osx 9 | osx_image: xcode7.3 10 | compiler: clang 11 | 12 | install: 13 | - sudo pip install bs4 14 | 15 | script: 16 | - mkdir build && cd build 17 | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then 18 | cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/ -DCMAKE_BUILD_TYPE=Release ../; 19 | else cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ../; 20 | fi 21 | - make -j4 22 | 23 | after_success: 24 | - python python/gumbo/gumboc_test.py 25 | - python python/gumbo/bs4_adapter_test.py 26 | - sudo python setup.py sdist install 27 | - python -c 'import gumbo; gumbo.parse("Foo")' 28 | -------------------------------------------------------------------------------- /gumbo_subtree/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ######################################################## 2 | # 3 | # This is a CMake configuration file. 4 | # To use it you need CMake which can be 5 | # downloaded from here: 6 | # http://www.cmake.org/cmake/resources/software.html 7 | # 8 | ######################################################### 9 | 10 | cmake_minimum_required( VERSION 3.18 ) 11 | 12 | project(gumbo) 13 | 14 | find_package(GTest) 15 | 16 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) 17 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/.libs) 18 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/.libs) 19 | 20 | set(TOP_BUILD_LEVEL ${PROJECT_BINARY_DIR}) 21 | 22 | if(NOT DEFINED GUMBO_STATIC_LIB) 23 | set(GUMBO_STATIC_LIB 0) 24 | endif() 25 | 26 | if(NOT DEFINED GUMBO_IS_SUBTREE) 27 | set(GUMBO_IS_SUBTREE 0) 28 | endif() 29 | 30 | add_subdirectory(src/) 31 | add_subdirectory(examples/) 32 | 33 | if( ${GTEST_FOUND} ) 34 | add_subdirectory(tests/) 35 | endif() 36 | 37 | -------------------------------------------------------------------------------- /gumbo_subtree/ChangeLog.txt: -------------------------------------------------------------------------------- 1 | List of Changes since the Fork 2 | ============================== 3 | In reverse chronological order: 4 | 5 | - remove long outdated vcxproj files, support building with cmake and nmake only on Windows 6 | - change update foreign attributes to remove xml:base and add xlink:arcrole to follow whatwg spec 7 | - fixed minor memory leaks 8 | - correctly handle text in form elements 9 | - support for new tags including search and to better follow the latest whatwg parsing spec 10 | - fix for handling

and
in foreign contexts 11 | - Fix multiple warnings including cast to enum from void pointer 12 | - Re-implement adjust_foreign_attributes() with a gperf hash 13 | - Remove special handling of tag 14 | - Remove special handling of tag 15 | - Use realloc(3) instead of malloc(3) in enlarge_vector_if_full() 16 | - Use realloc(3) instead of malloc(3) in maybe_resize_string_buffer() 17 | - Make destroy_node() function non-recursive 18 | - Fix signedness of some format specifiers 19 | - Add maximum element nesting limit 20 | - Remove custom allocator support 21 | - Fix recording of source positions for end tags 22 | - Fix TAGSET_INCLUDES macro to work properly with multiple bit flags 23 | - Re-implement gumbo_normalize_svg_tagname() with a gperf hash 24 | - Replace linear array search in adjust_svg_attributes() with a gperf hash 25 | - Fix duplicate TagSet initializer being ignored in is_special_node() 26 | - Add support for tag 27 | - Add missing static qualifiers to hide symbols that shouldn't be extern 28 | - Replace use of locale-dependant ctype.h functions with custom, ASCII-only equiv 29 | - add ability and interface to modify/edit the dom tree after parsing completes 30 | - allow support for xhtml parsing rules controllable via GumboOptions use_xhtml_rules flag 31 | -------------------------------------------------------------------------------- /gumbo_subtree/THANKS: -------------------------------------------------------------------------------- 1 | Gumbo HTML parser THANKS file 2 | 3 | Gumbo was originally written by Jonathan Tang, but many people helped out through suggestions, question-answering, code reviews, bugfixes, and organizational support. Here is a list of these people. Help me keep it complete and exempt of errors. 4 | 5 | Adam Barth 6 | Adam Roben 7 | Ben Noordhuis 8 | Bowen Han 9 | Constantinos Michael 10 | Craig Barnes 11 | Geoffrey Sneddon 12 | Ian Hickson 13 | Jack Deng 14 | Jonathan Shneier 15 | Kevin Hendricks 16 | Mason Tang 17 | Maxim Zakharov 18 | Neal Norwitz 19 | Othar Hansson 20 | Ryan Grove 21 | Stefan Haustein 22 | Steffen Meschkat 23 | Steven Kabbes 24 | Thiago Farina 25 | Vicent Marti 26 | -------------------------------------------------------------------------------- /gumbo_subtree/archived_upstream/CHANGES.md: -------------------------------------------------------------------------------- 1 | Gumbo 0.9.3 (2015-02-17) 2 | 3 | * Bugfix for Æ entities (rgrove) 4 | * Fix CDATA handling; CDATA sections now generate a GUMBO_NODE_CDATA node rather 5 | than plain text. 6 | * Fix get_title example to handle whitespace nodes (gsnedders) 7 | * Visual Studio compilation fixes (fishioon) 8 | * Take the namespace into account when determining whether a node matches a 9 | certain tag (aroben) 10 | * Replace the varargs tag functions with a tagset bytevector, for a 20-30% 11 | speedup in overall parse time (kevinhendricks, vmg) 12 | * Add MacOS X support to Travis CI, and fix the deployment/DLL issues this 13 | uncovered (nostrademons, kevinhendricks, vmg) 14 | 15 | Gumbo 0.9.2 (2014-09-21) 16 | 17 | * Performance improvements: Ragel-based char ref decoder and DFA-based UTF8 18 | * decoder, totaling speedups of up to 300%. 19 | * Added benchmarking program and some sample data. 20 | * Fixed a compiler error under Visual Studio. 21 | * Fix an error in the ctypes bindings that could lead to memory corruption in 22 | * the Python bindings. 23 | * Fix duplicate attributes when parsing tags. 24 | * Don't leave semicolons behind when consuming entity references (rgrove) 25 | * Internally rename some functions in preparation for an amalgamation file 26 | (jdeng) 27 | * Add proper cflags for gyp builds (skabbes) 28 | 29 | Gumbo 0.9.1 (2014-08-07) 30 | 31 | * First version listed on PyPi. 32 | * Autotools files excluded from GitHub and generated via autogen.sh. (endgame) 33 | * Numerous compiler warnings fixed. (bnoordhuis, craigbarnes) 34 | * Google security audit passed. 35 | * Gyp support (tfarina) 36 | * Naming convention for structs changed to avoid C reserved words. 37 | * Fix several integer and buffer overflows (Maxime2) 38 | * Some Visual Studio compiler support (bugparty) 39 | * Python3 compatibility for the ctypes bindings. 40 | 41 | Gumbo 0.9.0 (2013-08-13) 42 | 43 | * Initial release open-sourced by Google. 44 | -------------------------------------------------------------------------------- /gumbo_subtree/archived_upstream/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing 2 | =========== 3 | Bug reports are very much welcome. Please use GitHub's issue-tracking feature, as it makes it easier to keep track of bugs and makes it possible for other project watchers to view the existing issues. 4 | 5 | Patches and pull requests are also welcome, but before accepting patches, I need you to sign the Google Contributor License Agreement: 6 | 7 | https://developers.google.com/open-source/cla/individual 8 | https://developers.google.com/open-source/cla/corporate 9 | 10 | (Electronic signatures are fine for individual contributors.) 11 | 12 | If you're unwilling to do this, it would be most helpful if you could file bug reports that include detailed prose about where in the code the error is and how to fix it, but leave out exact source code. 13 | -------------------------------------------------------------------------------- /gumbo_subtree/archived_upstream/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright (c) 2013, Ben Noordhuis 4 | # 5 | # Permission to use, copy, modify, and/or distribute this software for any 6 | # purpose with or without fee is hereby granted, provided that the above 7 | # copyright notice and this permission notice appear in all copies. 8 | # 9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | 17 | if test -z "$LIBTOOLIZE" -a "`uname`" = "Darwin"; then 18 | LIBTOOLIZE=libtoolize 19 | fi 20 | 21 | set -ex 22 | ${LIBTOOLIZE:-libtoolize} 23 | ${ACLOCAL:-aclocal -I m4} 24 | ${AUTOCONF:-autoconf} 25 | ${AUTOMAKE:-automake} --add-missing 26 | -------------------------------------------------------------------------------- /gumbo_subtree/archived_upstream/benchmarks/arabic_newspapers.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sigil-Ebook/PageEdit/57649924346d29dea29de3d2aa8d6937daefcc57/gumbo_subtree/archived_upstream/benchmarks/arabic_newspapers.html -------------------------------------------------------------------------------- /gumbo_subtree/archived_upstream/configure.ac: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | 4 | AC_PREREQ([2.65]) 5 | AC_INIT([gumbo], [0.9.2], [jonathan.d.tang@gmail.com]) 6 | AC_CONFIG_MACRO_DIR([m4]) 7 | AC_CONFIG_SRCDIR([src/parser.c]) 8 | #AC_CONFIG_HEADERS([config.h]) 9 | AC_CONFIG_FILES([Makefile gumbo.pc]) 10 | 11 | # Checks for programs. 12 | AC_PROG_CXX 13 | AC_PROG_CC_C99 14 | 15 | # Checks for libraries. 16 | 17 | # Checks for header files. 18 | AC_CHECK_HEADERS([stddef.h stdlib.h string.h strings.h]) 19 | 20 | # Checks for typedefs, structures, and compiler characteristics. 21 | AC_C_INLINE 22 | AC_TYPE_SIZE_T 23 | 24 | # Checks for library functions. 25 | AC_CHECK_LIB([gtest_main], 26 | [main], 27 | AM_CONDITIONAL(HAVE_SHARED_LIBGTEST, [true]), 28 | AM_CONDITIONAL(HAVE_SHARED_LIBGTEST, [false])) 29 | 30 | # Init Automake & libtool 31 | AM_INIT_AUTOMAKE([foreign subdir-objects]) 32 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 33 | LT_INIT 34 | 35 | AC_OUTPUT 36 | -------------------------------------------------------------------------------- /gumbo_subtree/archived_upstream/gumbo.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: Gumbo 7 | Description: A fully-compliant HTML5 parser. 8 | Version: @PACKAGE_VERSION@ 9 | Libs: -L${libdir} -lgumbo 10 | Libs.private: @LIBS@ 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /gumbo_subtree/archived_upstream/gumbo_parser.gyp: -------------------------------------------------------------------------------- 1 | # Copyright 2013 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | { 16 | 'targets': [ 17 | { 18 | 'target_name': 'gumbo_parser', 19 | 'type': 'static_library', 20 | 'cflags': ['-std=c99', '-Wall'], 21 | 'sources': [ 22 | 'src/attribute.c', 23 | 'src/attribute.h', 24 | 'src/char_ref.c', 25 | 'src/char_ref.h', 26 | 'src/error.c', 27 | 'src/error.h', 28 | 'src/gumbo.h', 29 | 'src/insertion_mode.h', 30 | 'src/parser.c', 31 | 'src/parser.h', 32 | 'src/string_buffer.c', 33 | 'src/string_buffer.h', 34 | 'src/string_piece.c', 35 | 'src/string_piece.h', 36 | 'src/tag.c', 37 | 'src/token_type.h', 38 | 'src/tokenizer.c', 39 | 'src/tokenizer.h', 40 | 'src/tokenizer_states.h', 41 | 'src/utf8.c', 42 | 'src/utf8.h', 43 | 'src/util.c', 44 | 'src/util.h', 45 | 'src/vector.c', 46 | 'src/vector.h', 47 | ], 48 | }, 49 | { 50 | 'target_name': 'gumbo_parser_unittests', 51 | 'type': 'executable', 52 | 'dependencies': [ 53 | 'gtest.gyp:gtest', 54 | 'gtest.gyp:gtest_main', 55 | 'gumbo_parser', 56 | ], 57 | 'include_dirs': [ 58 | '.', 59 | '..', 60 | 'src', 61 | ], 62 | 'sources': [ 63 | 'tests/attribute.cc', 64 | 'tests/char_ref.cc', 65 | 'tests/parser.cc', 66 | 'tests/string_buffer.cc', 67 | 'tests/string_piece.cc', 68 | 'tests/test_utils.cc', 69 | 'tests/test_utils.h', 70 | 'tests/tokenizer.cc', 71 | 'tests/utf8.cc', 72 | 'tests/vector.cc', 73 | ], 74 | }, 75 | ], 76 | } 77 | -------------------------------------------------------------------------------- /gumbo_subtree/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Build examples/clean_text to ensure c++ code can 2 | # be linked to newly built gumbo shared library. 3 | 4 | cmake_minimum_required(VERSION 3.18) 5 | 6 | # project(examples) 7 | 8 | 9 | if( APPLE ) 10 | set(CMAKE_MACOSX_RPATH 1) 11 | endif() 12 | 13 | if( UNIX) 14 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") 15 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") 16 | endif() 17 | 18 | set(CXX_APPS clean_text find_links prettyprint positions_of_class well_formed serialize ) 19 | 20 | set(C_APPS get_title ) 21 | 22 | target_include_directories(${PROJECT_NAME} BEFORE PUBLIC ${GUMBO_INCLUDE_DIRS}) 23 | 24 | foreach( app_name ${CXX_APPS} ) 25 | set( app_source_file "${app_name}.cc" ) 26 | add_executable( ${app_name} ${app_source_file} ) 27 | target_link_libraries( ${app_name} ${GUMBO_LIBRARIES} ) 28 | endforeach( app_name ${CXX_APPS} ) 29 | 30 | foreach( app_name ${C_APPS} ) 31 | set( app_source_file "${app_name}.c" ) 32 | add_executable( ${app_name} ${app_source_file} ) 33 | target_link_libraries( ${app_name} ${GUMBO_LIBRARIES} ) 34 | endforeach( app_name ${C_APPS} ) 35 | 36 | 37 | -------------------------------------------------------------------------------- /gumbo_subtree/python/gumbo/__init__.py: -------------------------------------------------------------------------------- 1 | """Gumbo HTML parser. 2 | 3 | These are the Python bindings for Gumbo. All public API classes and functions 4 | are exported from this module. They include: 5 | 6 | - CTypes representations of all structs and enums defined in gumbo.h. The 7 | naming convention is to take the C name and strip off the "Gumbo" prefix. 8 | 9 | - A low-level wrapper around the gumbo_parse function, returning the classes 10 | exposed above. Usage: 11 | 12 | import gumbo 13 | with gumboc.parse(text, **options) as output: 14 | do_stuff_with_doctype(output.document) 15 | do_stuff_with_parse_tree(output.root) 16 | 17 | - Higher-level bindings that mimic the API provided by html5lib. Usage: 18 | 19 | from gumbo import html5lib 20 | 21 | This requires that html5lib be installed (it uses their treebuilders), and is 22 | intended as a drop-in replacement. 23 | 24 | - Similarly, higher-level bindings that mimic BeautifulSoup and return 25 | BeautifulSoup objects. For this, use: 26 | 27 | import gumbo 28 | soup = gumbo.soup_parse(text, **options) 29 | 30 | It will give you back a soup object like BeautifulSoup.BeautifulSoup(text). 31 | """ 32 | 33 | from gumbo.gumboc import * 34 | 35 | try: 36 | from gumbo import html5lib_adapter as html5lib 37 | except ImportError: 38 | # html5lib not installed 39 | pass 40 | 41 | try: 42 | from gumbo.soup_adapter import parse as soup_parse 43 | except ImportError: 44 | # BeautifulSoup not installed 45 | pass 46 | -------------------------------------------------------------------------------- /gumbo_subtree/python/gumbo/bs4_adapter_test.py: -------------------------------------------------------------------------------- 1 | # Copyright 2012 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | """Tests for the Gumbo's BeautifulSoup Python adapter.""" 16 | 17 | __author__ = 'jdtang@google.com (Jonathan Tang)' 18 | 19 | import unittest 20 | 21 | import bs4_adapter 22 | 23 | 24 | class SoupAdapterTest(unittest.TestCase): 25 | 26 | def testSimpleParse(self): 27 | soup = bs4_adapter.parse( 28 | """ 29 | 35 | """) 36 | 37 | head = soup.head 38 | self.assertEqual(soup, head.parent.parent) 39 | self.assertEqual(u'head', head.name) 40 | self.assertEqual(0, len(head)) 41 | 42 | body = soup.body 43 | self.assertEqual(head, body.previousSibling) 44 | self.assertEqual(2, len(body)) #