From 847256125364914f967193d4a3f991af2c670220 Mon Sep 17 00:00:00 2001 From: Max Wolf Date: Thu, 18 May 2023 17:34:47 +0800 Subject: [PATCH 1/2] Remove line breaks for link extraction --- pdfx/extractor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pdfx/extractor.py b/pdfx/extractor.py index 67d376f..7799838 100644 --- a/pdfx/extractor.py +++ b/pdfx/extractor.py @@ -23,6 +23,7 @@ def extract_urls(text): + text = text.replace("\n", "") return set(re.findall(URL_REGEX, text, re.IGNORECASE)) From 70537e8ab23227ac792d7802ca99996bc7ef2e4a Mon Sep 17 00:00:00 2001 From: Max Wolf Date: Thu, 18 May 2023 17:37:24 +0800 Subject: [PATCH 2/2] Update version, README and package metadata --- README.md | 1 - pdfx/__init__.py | 2 +- pdfx/extractor.py | 1 + setup.py | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6c2e1b2..eb15379 100644 --- a/README.md +++ b/README.md @@ -176,5 +176,4 @@ Feedback, ideas and pull requests are welcome! Possible: - Timeout (see [#43](https://github.com/metachris/pdfx/issues/43)) -- Cuts off links that span two lines [#40](https://github.com/metachris/pdfx/issues/40) - Include Check-Links Results in Output [#39](https://github.com/metachris/pdfx/issues/39) diff --git a/pdfx/__init__.py b/pdfx/__init__.py index cc3e3b2..405cac3 100644 --- a/pdfx/__init__.py +++ b/pdfx/__init__.py @@ -33,7 +33,7 @@ from __future__ import absolute_import, division, print_function, unicode_literals __title__ = "pdfx" -__version__ = "1.4.1" +__version__ = "1.4.2" __author__ = "Chris Hager" __license__ = "Apache 2.0" __copyright__ = "Copyright 2015 Chris Hager" diff --git a/pdfx/extractor.py b/pdfx/extractor.py index 7799838..25058d9 100644 --- a/pdfx/extractor.py +++ b/pdfx/extractor.py @@ -23,6 +23,7 @@ def extract_urls(text): + # Remove line breaks in order to include links spanning over multiple lines text = text.replace("\n", "") return set(re.findall(URL_REGEX, text, re.IGNORECASE)) diff --git a/setup.py b/setup.py index 5fd003d..330a39d 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ def parse_requirements(filename): # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version="1.4.1", + version="1.4.2", description="Extract metadata and URLs from PDF files" ", and download all referenced PDFs", long_description=long_description,