diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..a25d399 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +custom: https://paypal.me/Leseratte \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..cebbb64 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,54 @@ +name: Bug Report +description: Report a bug with the ACSM plugin +labels: ["new-report"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: textarea + id: what-happened + attributes: + label: Bug description + description: What were you doing, and what didn't work? + placeholder: | + Please include all relevant information, such as: + - When does the error occur? (Installing plugin, linking ADE account, importing ACSM, ...) + - If the error happens during ACSM import: Is this an EPUB or a PDF book? + - If the error happens during ACSM import: In the plugin settings does it say "Authorized to ADE ID ..." or is there an error message? + - Did this work in the past and randomly stopped, or did this never work / you are installing the plugin for the first time? + validations: + required: true + - type: dropdown + id: os + attributes: + label: Operating system + description: Which OS are you running Calibre on? + multiple: true + options: + - Linux + - Windows + - MacOS + validations: + required: true + - type: input + id: calibre-version + attributes: + label: Which version of Calibre are you running? + description: "Example: 5.30" + placeholder: "5.30" + validations: + required: true + - type: input + id: plugin-version + attributes: + label: Which version of the DeACSM plugin are you running? + description: "Example: v0.0.10" + placeholder: "v0.0.10" + validations: + required: true + - type: textarea + id: anything-else + attributes: + label: Further information + description: Anything else you'd like to add to this bug report? \ No newline at end of file diff --git a/calibre-plugin/libadobe.py b/calibre-plugin/libadobe.py index 849d9c6..5d17f57 100644 --- a/calibre-plugin/libadobe.py +++ b/calibre-plugin/libadobe.py @@ -382,10 +382,17 @@ def hash_node_ctx(node, hash_ctx): attrKeys = node.keys() + + # Attributes need to be sorted attrKeys.sort() + # TODO Implement UTF-8 bytewise sorting: + # "Attributes are sorted first by their namespaces and + # then by their names; sorting is done bytewise on UTF-8 + # representations." + for attribute in attrKeys: hash_do_append_tag(hash_ctx, ASN_ATTRIBUTE) - hash_do_append_string(hash_ctx, "") + hash_do_append_string(hash_ctx, "") # TODO: "Element namespace"? Whatever that means... hash_do_append_string(hash_ctx, attribute) hash_do_append_string(hash_ctx, node.get(attribute)) @@ -395,6 +402,9 @@ def hash_node_ctx(node, hash_ctx): if (node.text is not None): hash_do_append_tag(hash_ctx, ASN_TEXT) hash_do_append_string(hash_ctx, node.text.strip()) + + # TODO: If the text is longer than 0x7FFF, split it up and use multiple ASN_TEXT elements. + hash_do_append_tag(hash_ctx, ASN_END_TAG) else: hash_do_append_tag(hash_ctx, ASN_CHILD)