aboutsummaryrefslogtreecommitdiff
path: root/html.c
Commit message (Collapse)AuthorAgeFilesLines
* html.c: Replace \n with <br> on html_encodeXavier Del Campo Romero2025-09-281-1/+2
| | | | | This replacement can come in handy for library users dealing with multi-line user-generated content.
* html: Make html_encode publicXavier Del Campo Romero2025-09-281-1/+1
| | | | | Among other reasons, this function can be useful to sanitize user-generated content before assigning it do a node.
* html.c: Do not recurse on siblingsXavier Del Campo Romero2025-09-271-7/+21
| | | | | It is not required to do so. Otherwise, nodes with many siblings could lead to a very deep call stack for no reason.
* html.c: Avoid half-init objects on html_node_add_attrXavier Del Campo Romero2024-02-191-12/+23
| | | | | | The previous implementation would leave half-initialised objects if one of the calls to strdup(3) failed. Now, n->attrs is only modified when all previous memory allocations were successful.
* Rename project from slweb to libwebv0.1.0-rc3Xavier Del Campo Romero2023-10-111-1/+1
| | | | | | | | | | | | It was found out there was another project of the same name around (https://git.sr.ht/~strahinja/slweb/), also related to website generation. In order to avoid confusion, a new name has been chosen for this project. Surprisingly, libweb was not in use by any distributions (according to https://repology.org and AUR index), and it should reflect well the intention behind this project i.e., being a library to build web-related stuff.
* html.c: Fix wrong encoding for '>' and '<'Xavier Del Campo Romero2023-08-081-2/+2
|
* html.c: Make serialize_node staticXavier Del Campo Romero2023-07-281-2/+2
|
* Move header files to subdirectoryXavier Del Campo Romero2023-07-211-1/+1
| | | | | | | | | | | Since slweb is meant as a library, it is advisable to keep public header files under their own directory in order to avoid name clashing i.e., #include "something.h" Now becomes: #include "slweb/something.h"
* Define _POSIX_C_SOURCEXavier Del Campo Romero2023-07-201-0/+2
| | | | | This allows using the default compiler defined by make(1) (i.e., c99(1)), thus improving POSIX compatibility.
* html.c: Allow empty strings on html_encodeXavier Del Campo Romero2023-07-201-0/+6
|
* Fix memory leak on failed realloc(3)Xavier Del Campo Romero2023-07-201-4/+9
| | | | | | | | | | According to C99 ยง7.20.3.4: If memory for the new object cannot be allocated, the old object is not deallocated and its value is unchanged. Therefore, a temporary pointer must be used to ensure the original object can still be deallocated should realloc(3) return a null pointer.
* Initial commitXavier Del Campo Romero2023-07-201-0/+288