about summary refs log tree commit diff stats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Compile with styleCheck:usagesbptato2023-12-2824-67/+67
| | | | much better
* dom: export import maps allowedbptato2023-12-251-1/+1
| | | | whoops
* dom: use JS_EvalFunction; add module fetching stubsbptato2023-12-256-51/+164
| | | | (still no module support in buffer...)
* Fix warnings on Nim 2.0.2bptato2023-12-242-3/+3
| | | | | | | | One is a false-positive (in dom). The other one in pager is something I hadn't noticed before, that's nice. For now I want to avoid making a change that may break things, so I just removed the dead code.
* bindings/quickjs: cint -> csize_tbptato2023-12-232-3/+5
| | | | | | cint was incorrect :/ Makes me wonder if maybe we should just use futhark after all...
* dom: use std/ in importsbptato2023-12-221-8/+8
|
* dom: simplify fetch classic scriptbptato2023-12-221-22/+21
|
* buffer: prevent crash in reshape before document is parsedbptato2023-12-221-0/+2
| | | | Can happen e.g. if the window is resized or the user manually reshapes.
* buffer: clean up ssock on being killedbptato2023-12-213-21/+40
| | | | | | * use signal handlers to avoid littering tmpdir with dead sockets * add connection reset error (for socketstream) * convert some imports to new style
* cgi: return ConnectionError when script is not executablebptato2023-12-212-1/+3
|
* loader: refactor onRead/onErrorbptato2023-12-211-19/+22
| | | | | | It was originally written this way to accomodate for the broken std file API. We no longer use that in buffer, so we can use a more correct version now.
* container: fix gotoMarkYbptato2023-12-211-1/+1
| | | | | | Now it actually does what it was supposed to do. Also, clarify what it does in config.md
* js: fix nil deref in jsgetpropbptato2023-12-201-4/+9
| | | | Turns out desc can in fact be nil.
* html/dom: do not submit implicitly if there is a submit buttonbptato2023-12-181-8/+10
| | | | | | | | | | | | | | | | See e.g. the sr.ht issue tracker, now forever tainted by the tickets I accidentally submitted :P Chawan will gladly autosubmit without the user having written anything in the textbox just by writing some text in the title. The problem is that graphical web browsers typically have a "submit" keybinding (enter), and a "next field" keybinding (tab). The implicit submission mechanism was created with graphical browsers in mind; like w3m, Chawan only has an "ok" keybinding, which may or may not also mean "submit". With this solution, only forms that could not otherwise be submitted will autosubmit.
* socketstream: get rid of emitsbptato2023-12-183-50/+75
| | | | Use .compile, as that is supported by nlvm too.
* strwidth & url fixesbptato2023-12-163-7/+7
| | | | | | * actually search Combining for isCombining * fix searchInMap * fix cmpRange of url
* container: fix multi-byte selections, do not append newlinebptato2023-12-161-7/+11
| | | | | | We need to select (first byte of first char)..(last byte of last char). Also, in line/block mode we no longer add the final newline to selections.
* config/toml: fix consumeComment overriding nodesbptato2023-12-151-1/+2
| | | | | We must first check if there is really no node to attach the comment to...
* config: allow overriding default prepended schemebptato2023-12-152-2/+4
|
* Implement local CGI error message handlingbptato2023-12-157-8/+44
| | | | | | This was documented, but not implemented until now. Also, improve the loader module's protocol documentation.
* ftp: fix unnecessary slashes being added to path; move bindings/curlbptato2023-12-151-425/+0
| | | | also in ftp: clean up resources before exit
* buffer: use BufferSize constantbptato2023-12-151-1/+1
|
* Set ishtml in the correct place, take ishtml on clonebptato2023-12-151-1/+2
|
* container: track ishtml statusbptato2023-12-152-1/+4
| | | | | This way we can at least view HTML source of x-htmloutput filtered buffers. TODO: make it render the actual source instead.
* charcategory: move out isDigitAsciibptato2023-12-143-6/+4
| | | | so we do not have to import unicode
* socketstream, serversocket: portable bindUnixbptato2023-12-144-10/+50
| | | | | reimplementing it portably in Nim seems incredibly annoying, so we just use C
* client: nil check connectSocketStream resultbptato2023-12-141-0/+5
| | | | | It may fail if the buffer process could not successfully create a server socket.
* client: avoid nil defect in flushConsolebptato2023-12-141-0/+5
|
* config: do not override user-defined urimethodmapbptato2023-12-142-1/+6
| | | | UMM resolution takes the first entry.
* chapath: add missing returnbptato2023-12-141-1/+2
|
* loaderhandle: fix ConversionDefect in getFdbptato2023-12-131-2/+7
| | | | | We must save fd in the constructor, because the stream type may be changed while loading.
* Various fixesbptato2023-12-137-40/+52
| | | | | | | * Makefile: fix parallel build, add new binaries to install target * twtstr: split out libunicode-related stuff to luwrap * config: quote default gopher2html URL env var for unquote * adapter/: get rid of types/url dependency, use CURL url in all cases
* http: use CURLU for URLsbptato2023-12-131-0/+78
|
* break up twtstr somewhatbptato2023-12-1318-380/+397
| | | | | Avoid computing e.g. charwidth data for http which does not need it at all.
* Move http out of main binarybptato2023-12-1314-358/+195
| | | | | | | | | | | | Now it is (technically) no longer mandatory to link to libcurl. Also, Chawan is at last completely protocol and network backend agnostic :) * Implement multipart requests in local CGI * Implement simultaneous download of CGI data * Add REQUEST_HEADERS env var with all headers * cssparser: add a missing check in consumeEscape
* Move gopher to adapter/bptato2023-12-123-164/+1
| | | | Also, move default urimethodmap config to res.
* Move out ftp: protocol; fix some local CGI bugsbptato2023-12-124-217/+18
|
* Move out file: protocol handling to adapter/bptato2023-12-124-130/+4
|
* local CGI improvements, move data: to cgi-binbptato2023-12-125-58/+88
| | | | error codes are WIP, not final yet...
* twtstr: import functions from gopher2htmlbptato2023-12-121-15/+10
|
* local CGI: add mapped URI env vars; move about: to adaptersbptato2023-12-124-41/+22
| | | | | | | | | | | | | | | * Add MAPPED_URI_* as environment variables when a request is coming from urimethodmap It costs us compatibility with w3m, but it seems to be a massive improvement over smuggling in the URL as a query string and then writing an ad-hoc parser for every single urimethodmap script. The variables are set for every urimethodmap request, to avoid accidental leaking of global environment variables. * Move about: to adapters (an obvious improvement over the previous solution)
* layout: rounding error correction fixesbptato2023-12-111-2/+6
| | | | | * start from 1 * divide by total - 1, since we are counting the rounding error between each line
* css: add case-insensitive matchingbptato2023-12-113-18/+96
| | | | Also case-sensitive, but for now that is the same as normal matching...
* css: add text-transformbptato2023-12-113-11/+163
| | | | | | | Probably not fully correct, but it's a good start. Includes proprietary extension -cha-half-width, which converts full-width characters to half-width ones.
* layout: do not resolve floats if grandparent position is resolvedbptato2023-12-101-2/+2
| | | | | | | | | | Instead, position them at the end of their block's layout pass. Without this, they could be positioned too early, as the grandparent's position being resolved does not guarantee that the parent's position has already been resolved as well. (Unlike the comment suggests, flushMargins is not appropriate there.)
* layout: fix rounding error correctionbptato2023-12-101-11/+8
| | | | | * Actually calculate rounding error * Skip a loop over lines by accumulating rounding error in finishLine
* Add support for gemini by default, update readmebptato2023-12-101-6/+17
| | | | | No need to leave gemini support in the bonus folder. Still TODO: proxy support.
* mailcap: add $MAILCAP_URLbptato2023-12-102-1/+3
| | | | | | This is better than %u as it is backwards compatible (i.e. does not rely on other user agents doing whatever upon encountering an unknown substitution template.)
* Separate gopher conversion from main binarybptato2023-12-103-116/+28
| | | | | | | | | | | | | | | | | | | | | Now we use a (much simplified) gopher2html binary in libexec, instead of converting gopher directories to HTML in loader/gopher. This has two advantages: * Less ugly conversion logic in the loader module; we can just convert the file line by line. (The previous converter also had some correctness issues, that is fixed now as well.) * If the user desires, they can replace the gopher converter with another binary using the mailcap mechanism. The disadvantages are: * For now, source display is broken. This is a problem with all mailcap filters in general, and should be fixed in the future. (That said, the previous version also only displayed the converted HTML source, which was not really useful anyway.) * The proper directory structure is required for this to work; OTOH plenty of work has been done so that this is as frictionless as possible, so it should not really be a problem.
* Enable finger protocol by defaultbptato2023-12-102-1/+9
| | | | | | * Add a default urimethodmap that points finger: to cha-finger * Install cha-finger to /usr/local/libexec/cha/cgi-bin by default * cha-finger: use ALL_PROXY if given, die if curl is not installed