Commit Graph

438 Commits

Author SHA1 Message Date
Yuri Kobets
1458495dd4 Merge branch 'master' of github.com:litehtml/litehtml 2021-11-05 20:22:19 +03:00
Yuri Kobets
beeb735ed3 Fixed bugs in fonts handling in container_linux 2021-11-05 20:21:49 +03:00
Yuri Kobets
cd72813881 Fixed parsing of escape sequence for :before and :after classes 2021-11-05 20:20:26 +03:00
Yuri Kobets
eda357bded Fixed build errors on Windows 2021-11-05 03:33:14 +03:00
Yuri Kobets
d4209476bc Add t_ prefix for functions litehtml::strcasecmp, litehtml::strncasecmp, litehtml::tolower and litehtml::isdigit 2021-11-05 02:32:49 +03:00
g4mba5
4dc1a18fc3
Add custom implementations of 'strcasecmp', 'strncasecmp', 'tolower' and 'isdigit' that ignore the current locale (#178)
Add custom implementations of 'strcasecmp', 'strncasecmp', 'tolower' and 'isdigit' that ignore the current locale
2021-11-05 02:16:30 +03:00
Yuri Kobets
aaf3fba8ed Updated container_linux 2021-11-05 01:47:15 +03:00
Yuri Kobets
bb04a50f93 Add a custom 'strtod' implementation that ignores the current locale. 2021-11-04 23:22:54 +03:00
Yuri Kobets
f00bc949f7 Revert "Add a custom 'strtod' implementation that ignores the current locale." 2021-11-04 16:54:12 +03:00
Yuri Kobets
46b403ddd2
Merge pull request #177 from g4mba5/g4mba5-patch-strtod
Add a custom 'strtod' implementation that ignores the current locale.
2021-11-04 16:46:33 +03:00
Yuri Kobets
d45cbbb558
Merge branch 'master' into g4mba5-patch-strtod 2021-11-04 16:44:19 +03:00
Yuri Kobets
1f36d26f30 Added document_container::split_text to use custom text splitting engines 2021-11-01 02:53:40 +03:00
Yuri Kobets
ccccc5f17e Revert "Add an option to use ICU to locate word boundaries" 2021-11-01 01:53:08 +03:00
Yuri Kobets
ac6bbc7d2a Added table caption support 2021-11-01 01:25:35 +03:00
g4mba5
66bfe38661
Custom 'strtod' implementation. 2021-10-30 21:59:22 +02:00
g4mba5
0fea186f0e
'strtod' declaration 2021-10-30 21:56:41 +02:00
g4mba5
2164e69327
The custom 'strtod' will be implemented directly in 'litehtml' namespace 2021-10-30 21:55:46 +02:00
g4mba5
626f5a34a0
Make 't_strtod' points at its implementation in 'document.cpp' 2021-10-30 21:11:19 +02:00
Yuri Kobets
6236113734
Merge pull request #173 from Dushistov/fix-warnings
fix "scaring" warnings
2021-10-28 22:05:16 +03:00
Evgeniy A. Dushistov
971eadced8 fix "scaring" warnings
1. usage of virtual functions without destructor,
   not public not-virtual destructor + final convinced compiler that
   all ok
2. couple of unused variables and arguments (the most noisy one)
3. extra copy in cycle
4. std::move prevent copy elision warning
2021-10-28 13:56:59 +03:00
Yuri Kobets
b095539f8d
Merge pull request #172 from ericLemanissier/patch-2
url: include algorithm
2021-10-28 11:21:06 +03:00
Yuri Kobets
eaf23800db
Merge pull request #171 from ericLemanissier/patch-1
don't fetch googletest if testing is disabled
2021-10-28 11:20:26 +03:00
ericLemanissier
9af467f7cf
url: include algorithm
it is needed for std::min
2021-10-28 08:07:07 +02:00
ericLemanissier
11c6b88af2
don't fetch googletest if testing is disabled 2021-10-28 07:23:03 +02:00
Yuri Kobets
fb276993c2
Merge pull request #170 from ericLemanissier/patch-1
include cstdint int os_types
2021-10-27 22:53:37 +03:00
ericLemanissier
af9061a2c8
include cstdint int os_types
it is needed for uintptr_t
2021-10-27 14:02:23 +02:00
Yuri Kobets
c64c0c40f4
Merge pull request #168 from mjvankampen/missing-tstring_view.h-include
Adds ptrdiff_t include to tstring_view.h
2021-10-27 12:03:58 +03:00
Mark Jan van Kampen
131f207e01
Adds ptrdiff_t include to tstring_view.h
On some platforms ptrdiff_t is included through other system headers, on
others not. By including cstddef the code should compile on all platforms
that comply with the standard.
2021-10-27 10:43:50 +02:00
Yuri Kobets
5fe0b82789
Merge pull request #167 from mjvankampen/fix/utf8_string.h-missing-includes
Adds missing includes to utf8_strings.h
2021-10-27 10:07:24 +03:00
Mark Jan van Kampen
bb01af1c36
Adds missing includes to utf8_strings.h 2021-10-27 06:49:11 +02:00
Yuri Kobets
5c7065a217
Merge pull request #164 from primatelabs/url-class
Add a url class
2021-10-05 10:20:42 +03:00
Yuri Kobets
750abc1a1e
Merge pull request #161 from primatelabs/icu4c
Add an option to use ICU to locate word boundaries
2021-10-05 10:14:59 +03:00
John Poole
463cfc2de1
Merge branch 'master' into url-class 2021-09-25 20:26:05 -04:00
John Poole
5460deec6b
Merge pull request #3 from primatelabs/tstring_view
Add tstring_view, a string reference type
2021-09-25 20:24:38 -04:00
John Poole
441191ae6d
Merge pull request #2 from primatelabs/icu4c
Add an option to use ICU to locate word boundaries
2021-09-25 20:21:29 -04:00
John Poole
a39f78834f
Merge pull request #1 from primatelabs/github-actions
Switch from Travis to GitHub Actions
2021-09-25 20:15:13 -04:00
John Poole
501c31a7f5 Remove Travis build scripts and related files 2021-09-25 20:03:04 -04:00
John Poole
8bbf9afed6 Disable test that only fails on GitHub Actions
CSSTest.SelectorParse fails on GitHub Actions but not on Travis or on
any developer systems.  Disable the test until we can determine what's
going on here.
2021-09-25 19:51:12 -04:00
John Poole
d18a02ed63 Re-run failed test cases verbosely
Verbose output will make it easier to determine why test cases are
failing (especially when they only fail in the CI system).
2021-09-25 19:25:01 -04:00
John Poole
d33a46556a
Create cmake.yml 2021-09-25 17:47:10 -04:00
John Poole
527fbe3413 Extend URL path resolution to handle relative paths
This is implemented using several URL path helper functions.  The
functions aren't strictly necessary, but the functions make it easier
to implement and test the resolution functionality.
2021-09-25 13:52:56 -04:00
John Poole
d3c368458d Add a url class
The url class is a URL parser and container class that makes working
with URLs easier.  In particular, the resolve() function makes working
with base URLs and possibly relative URLs easier.

url instances are meant to be immutable.  If users need to modify a
url instance they can do so by creating a new url instance.  See the
resolve() implementation for a non-trivial example of how to build a
new url instance using existing url instances.

Note that the current implementation is inefficient due to each URL
component requiring its own separate memory allocation.  We should
consider re-writing this to use tstring_view once that branch is
merged into master.
2021-09-25 11:58:31 -04:00
John Poole
3147b4fc78 Add codepoint utility functions, tests
Add codepoint utility functions that test whether a codepoint belongs
to a set of codepoints (e.g., the valid codepoints for a URL scheme).
Most of these functions are implemented using a compact lookup table
so should be reasonably fast.

The functions are based on similar functions from the css-parser branch
that were introduced in commit 1698324920.  We'll want to merge these
sets of functions together once the branches are merged.
2021-09-25 11:57:52 -04:00
John Poole
14e2001376 Add tstring_view, a string reference type
tstring_view is a string reference type that provides a view into a
string that is owned elsewhere (e.g., by a std::string object).

tstring_view implements the same interface as std::base_string_view in
the standard library.  When litehtml moves to C++17 consider replacing
the tstring_view implementation with the standard library
implementations (e.g., via a using statement).
2021-09-23 14:56:34 -04:00
John Poole
2cb2990e9f Add an option to use ICU to locate word boundaries
Add a CMake option (USE_ICU) to enable the use of ICU to locate word
boundaries in strings.  If USE_ICU is enabled then split_text_node()
uses ICU's BreakIterator to split up a text node.  If USE_ICU is
disabled then split_text_node() uses the existing implementation to
split up a text node.

USE_ICU is disabled by default so this does not introduce a dependency
on ICU for existing litehtml users.
2021-09-21 19:46:03 -04:00
John Poole
efd556bed6 Strip trailing whitespace 2021-09-21 17:13:22 -04:00
John Poole
7970b3b180 Move code that splits text nodes into split_text_node() function
This should make it easier to provide alternate implementations of
split_text_node() in the future (e.g., one based on the break
iteration found in ICU4C).
2021-09-21 00:37:44 -04:00
Yuri Kobets
294780d910
Merge pull request #159 from primatelabs/googletest
Convert litehtml tests to use GoogleTest
2021-09-03 09:59:31 +03:00
John Poole
95d2e891f7 Replace FetchContent_MakeAvailable()
FetchContent_MakeAvailable() was introduced in CMake 3.14.  Use
FetchContent_GetProperties() and FetchContent_Populate() instead as
per the CMake FetchContent documentation:

  https://cmake.org/cmake/help/latest/module/FetchContent.html

This change also bumps the required version of CMake from 3.5 to 3.11.
2021-08-25 20:37:11 -04:00
John Poole
7501793675 Convert litehtml tests to use GoogleTest
GoogleTest provides a number of nice features (such as autodiscovery)
that make writing and running tests easier and less tedious.  This
patch converts the litehtml tests over to use GoogleTest.  Note that
the conversion is mostly mechanical -- no attempt has been made to
make the tests "idiomatic" GoogleTests.

Most of the CMake changes are based on code from the GoogleTest
documentation, specifically the "Quickstart: Building with CMake"
guide:

  https://google.github.io/googletest/quickstart-cmake.html
2021-08-25 17:51:12 -04:00