Commit Graph

951 Commits

Author SHA1 Message Date
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
Yuri Kobets
2c033bff0b
Merge pull request #156 from kkoehne/master
gumbo: Fix MSVC warnings (64 bit)
2021-05-27 18:42:22 +03:00
Kai Köhne
f66b854983 gumbo: Fix MSVC warnings about conversion from '__int64' to 'int'
Fix warnings like
 utf8.c(140): warning C4244: '=': conversion from '__int64' to 'int', possible loss of data
2021-05-27 15:22:03 +02:00
Kai Köhne
7ada04638d gumbo: Fix MSVC warnings about conversion from 'size_t' to 'int'
Fix warnings like
  warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
  warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data

with Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30037 for x64
2021-05-27 14:54:57 +02:00
Yuri Kobets
b4c815c0ed
Merge pull request #150 from manisandro/master
Add licenses for bundled libraries, compile xxd from source instead of using pre-built binary
2021-03-23 19:28:34 +03:00
Sandro Mani
b49f3733a1 Bundle xxd as source, add option whether to use external xxd, add
license for xxd
2021-03-23 16:48:28 +01:00
Sandro Mani
66a8c38799 Add ASL2.0 license text for bundled gumbo 2021-03-23 16:48:28 +01:00
Yuri Kobets
68f9756edb
Merge pull request #149 from manisandro/master
Add option to link against external gumbo
2021-03-23 14:49:43 +03:00
Sandro Mani
86930c5a77 Add option to link against external gumbo 2021-03-23 11:41:36 +01:00
Yuri Kobets
b6442d9f34
Merge pull request #148 from manisandro/master
Patches from Fedora packaging
2021-03-17 17:36:34 +03:00
Sandro Mani
befbf12bf4 Honour LIB_SUFFIX to support distros using lib64 2021-03-17 11:32:38 +01:00
Sandro Mani
dbff4b5cbd Add soversion 2021-03-17 11:31:34 +01:00
Yuri Kobets
db7f59d588
Merge pull request #144 from cristianadam/master
Build fix for MSVC 2019
2020-12-17 01:24:04 +03:00
Cristian Adam
3f3ccddc6e Build fix for MSVC 2019
Fixes failures like:
..\..\src\plugins\help\qlitehtml\litehtml\src\num_cvt.cpp(62):
error C2440: 'initializing': cannot convert from 'const char [2]' to
'litehtml::tchar_t *' ..\..\src\plugins\help\qlitehtml\litehtml\src\num_cvt.cpp(62):
note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
2020-12-15 18:59:59 +01:00
Yuri Kobets
f016b0453f
Merge pull request #143 from e4z9/master
Increase minimum CMake version to 3.5
2020-12-15 18:23:16 +03:00
Eike Ziller
72ba3e516f Increase minimum CMake version to 3.5
CMake 3.19 starts warning:
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

CMake 3.5 is already a very low minimum requirement.
2020-12-15 16:08:35 +01:00
Yuri Kobets
8c1f09405a
Merge pull request #142 from e4z9/master
Fix box width for ordered list markers
2020-12-15 12:30:34 +03:00
Eike Ziller
894985ac0b Fix box width for ordered list markers
Amends 58e92d6dc6
2020-11-19 13:26:36 +01:00
Yuri Kobets
f06d139a0c
Merge pull request #137 from fpw/fix/float-left-padding
Fix #136 without breaking #51
2020-07-01 22:26:03 +03:00
Folke Will
cb8bff05a8 Fix indentation 2020-06-27 00:49:41 +02:00
Folke Will
c1657f5e29 Fix #51 and #136 2020-06-27 00:47:40 +02:00
Yuri Kobets
8eb3da4b75
Merge pull request #134 from JamieEclipse/master
Added support for loading HTML into an existing element
2020-06-15 00:35:41 +03:00
Unknown
3b0affe68e Remove accidental temporary code to fix line breaks 2020-06-14 16:55:56 +01:00
Unknown
da53571a47 Added support for loading HTML into an existing element 2020-06-14 01:13:51 +01:00
Yuri Kobets
9e97f54890
Merge pull request #131 from jfpoole/fix-cmake-build
Fix CMake build on Linux
2020-05-18 10:10:20 +03:00
John Poole
b874f00bdb Add missing file to CMakeLists.txt 2020-05-17 17:10:58 -04:00
Yuri Kobets
58e92d6dc6 Extended support for ordered lists.
Supported list-style-type: decimal, decimal-leading-zero, lower/upper-latin, lower/upper-alpha, lower/upper-roman, lower-greek
2020-05-10 02:55:34 +03:00
Alex Zhondin
259d96c2e1 added missing files 2020-05-09 13:44:24 +03:00
Alex Zhondin
948930ad35 support ordered lists 2020-05-09 13:44:24 +03:00
Charlie Kindel
97f92ca720 Support font names surrounded by single quotes 2020-02-16 17:26:19 +01:00
Charlie Kindel
da936b351e Merge branch 'master' of tig:tig/litehtml 2020-02-16 16:44:40 +01:00
Charlie Kindel
433da5df8c Fix for building litehtmlbrowser in VS2016 2020-02-16 16:44:23 +01:00
Charlie Kindel
784248e800 Merge branch 'master' of tig:litehtml/litehtml 2020-01-19 20:16:43 -08:00
Charlie Kindel
9c84142406 modified to build in VS2019 2020-01-04 22:44:41 -08:00
Yuri Kobets
90555f1758
Merge pull request #119 from adamfowleruk/feature-haiku
Feature haiku
2020-01-02 04:13:46 +03:00
Adam Fowler
eb433d8d66 Added rendering of html string 2020-01-01 10:44:08 -05:00
Adam Fowler
a3f0c1ca14 Updated README for Haiku OS support 2020-01-01 09:42:59 -05:00
Yuri Kobets
37fdac3fbf
Merge pull request #118 from adamfowleruk/feature-haiku
Feature haiku
2019-12-31 23:29:42 +03:00
Adam Fowler
911a6daf73 Added rendered message sending 2019-12-31 11:47:37 -05:00
Adam Fowler
4a58d5099d First Haiku container implementation 2019-12-30 15:52:30 +00:00
Yuri Kobets
816730ff1f
Merge pull request #112 from e4z9/master
Fix build with MSVC 2019 and CMake
2019-10-28 16:26:41 +03:00
Eike Ziller
42ceb48b4b Fix build with MSVC 2019 and CMake
The WIN32 define is missing with MSVC 2019, use _WIN32
2019-10-28 14:10:50 +01:00
Yuri Kobets
377d4dff56
Merge pull request #109 from great90/master
delete repeated include
2019-10-12 13:01:22 +03:00