about summary refs log tree commit diff stats
path: root/src/utils/twtstr.nim
Commit message (Collapse)AuthorAgeFilesLines
* regex: re-work compileSearchRegexbptato2024-02-171-0/+16
| | | | | | | I've gotten tired of not being able to search for forward slashes. Now it works like in vim, and you can also set default ignore case in the config.
* twtstr: misc refactoringsbptato2024-02-091-141/+24
| | | | | | * move out half width <-> full width converters * snake_case -> camelCase * improve toScreamingSnakeCase slicing
* mimetypes: simplify parseMimeTypesbptato2024-01-271-0/+6
| | | | | * use functions like until * do not call atEnd for every line, use boolean readLine instead
* Add urlenc, urldec; fix a URL encoding bug; improve trans.cgibptato2024-01-081-12/+18
| | | | | | | | | | * Fix incorrect internal definition of the fragment percent-encode set * urlenc, urldec: these are simple utility programs mainly for use with shell local CGI scripts. (Sadly the printf + xargs solution is not portable.) * Pass libexec directory as an env var to local CGI scripts * Update trans.cgi to use urldec and add an example for combining it with selections
* Use std/* imports everywherebptato2024-01-071-11/+11
|
* charcategory: move out isDigitAsciibptato2023-12-141-1/+1
| | | | so we do not have to import unicode
* Various fixesbptato2023-12-131-37/+0
| | | | | | | * 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
* break up twtstr somewhatbptato2023-12-131-369/+9
| | | | | Avoid computing e.g. charwidth data for http which does not need it at all.
* twtstr: import functions from gopher2htmlbptato2023-12-121-15/+10
|
* css: add case-insensitive matchingbptato2023-12-111-0/+14
| | | | Also case-sensitive, but for now that is the same as normal matching...
* css: add text-transformbptato2023-12-111-3/+113
| | | | | | | 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.
* config: better path handling; fix array parsing bugbptato2023-12-101-1/+1
| | | | | | | | | * Paths are now parsed through an unified code path with some useful additions like environment variable substitution. * Fix a bug in parseConfigValue where strings would be appended to existing arrays (and not override them). * Fix beforeLast calling afterLast for some reason. * Add a default CGI directory.
* html: add HTMLElement.dataset (+ some twtstr cleanup)bptato2023-12-011-11/+19
|
* twtstr: simplify expandPathbptato2023-11-291-19/+12
|
* twtstr: remove tolower, isWhitespacebptato2023-11-201-18/+4
| | | | | | | | * tolower: strutils toLowerAscii is good enough for the cases where we need it. Also, it's easy to confuse with unicode toLower and vice versa. * isWhitespace: in AsciiWhitespace is more idiomatic. Also has a naming collision with unicode toLower.
* Add -C optionbptato2023-10-271-0/+7
|
* twtstr: optimize widthbptato2023-10-011-34/+17
|
* Add urimethodmap supportbptato2023-09-301-4/+2
| | | | yay
* remove sequtils dependencybptato2023-09-241-3/+5
|
* ftp: encode paths, escape displayed stringsbptato2023-09-191-0/+17
| | | | avoid e.g. # being interpreted as a fragment
* term: simplify/cleanupbptato2023-09-181-0/+9
|
* twtstr: remove unused functionsbptato2023-09-181-22/+0
| | | | lineedit no longer needs these
* lineedit: rewritebptato2023-09-181-0/+22
| | | | | | | | | | | | | | | | The old lineedit system worked quite well in the original synchronous model. However, because it needs access to the terminal, it has been subtly broken ever since buffer updates are allowed while the user is in line edit mode. This is best observed in incremental search, where searching for a bgcolor'ed text would result in the bgcolor bleeding into the line editor box. The new version is much simpler, and therefore less optimized. But it can still take advantage of output optimization in the terminal controller, and it is free of races (because we simply query the current state from the pager and feed it into the main output grid).
* data urls: percent decodebptato2023-09-151-2/+2
|
* Fix compilation with --assertions:offbptato2023-09-151-1/+2
| | | | | Remove side effects from assert statements. The flag is not used currently, but let's not depend on that.
* move around more modulesbptato2023-09-141-1/+1
| | | | | | | | | | * ips -> io/ * loader related stuff -> loader/ * tempfile -> extern/ * buffer, forkserver -> server/ * lineedit, window -> display/ * cell -> types/ * opt -> types/
* twtstr: simplifybptato2023-09-131-11/+5
| | | | | | * remove unused function isAlphaAscii * swap pushHex for less casting * remove == overload for char/rune (we did not really use it anyway)
* twtstr: remove some unused procsbptato2023-09-071-22/+0
| | | | | | | * substr for Rune with 1 param: gone, ideally the other should be removed too * clearControls: gone, not used anymore. * split for Rune: gone, not used anymore.
* twtstr: remove toLowerAscii2bptato2023-09-071-15/+0
|
* javascript: refactorbptato2023-08-281-2/+2
| | | | | | | Split out parts of the JS module, because it was starting to confuse the compiler a little. (Peakmem is back at 750M. Interesting.)
* css: implement case insensitivitybptato2023-08-101-8/+0
| | | | For some reason I forgot about this.
* Fixes & workarounds to compile on Nim 2.0.0bptato2023-08-011-2/+4
| | | | | | | | | | | | | | * Import punycode, as it has been removed from stdlib. * Fix some syntax errors * Apparently you can no longer compare distinct pointers with nil. Add explicit comparisons with typeof(nil) instead. * htmlparser: rename _ to other, as semantics of _ have changed. (Quite a shame, it looked better with _. Oh well.) * Explicitly specify mm:refc, as the browser OOMs with orc for some reason. Confirmed to compile & run on 2.0.0, 1.6.14, 1.6.12, 1.6.10 and 1.6.8. (<1.6.8 it's broken & wontfix.)
* Fix twtstr.cmpbptato2023-07-281-2/+2
| | | | We were comparing the wrong sides of ranges here.
* Fix toHex weirdnessbptato2023-07-071-7/+6
|
* Fixes in ipv6 parser and serializerbptato2023-07-071-3/+20
|
* Fix regression in twidthbptato2023-07-061-3/+3
|
* Add popup menu for select elementbptato2023-07-051-2/+3
| | | | | | | Replaces the weird CSS implementation we have had until now with a searchable popup menu similar to that of w3m. (The previous implementation broke on websites that do not expect <select> to expand on click, had no separate search, and was ugly.)
* Fix JS type conversion regressionsbptato2023-07-031-3/+4
|
* Fix CastSize warningsbptato2023-07-031-2/+2
| | | | Introduced by 1.6.14. Warns of undefined behavior.
* Factor out map search, remove sugarbptato2023-06-291-6/+8
|
* twtstr: remove unused functionbptato2023-06-251-13/+0
|
* Improve broken cookie handling, add multipart to formbptato2023-06-251-0/+11
| | | | | | | | Now it's not as horribly broken as before (but it's still far from perfect). We can at least log in to sr.ht (hooray). The form multipart part is straightforward, just pass what we used to pass long ago before I broke multipart.
* Rework JS exception systembptato2023-06-191-2/+2
| | | | | Now we use Result for passing exceptions to JS. As a result, we can finally get rid of the .jserr pragma.
* Use utils/opt in toml parserbptato2023-06-181-5/+6
|
* Fix some type confusion with colors, fix crash in pagerbptato2023-06-091-4/+37
|
* Add support for width, height media querybptato2023-06-071-0/+3
|
* Add support for canvas and multipartbptato2023-06-051-44/+50
| | | | | | | | | | | | | | | Quite incomplete canvas implementation. Crucially, the layout engine can't do much with whatever is drawn because it doesn't support images yet. I've re-introduced multipart as well, with the FormData API. For the append function I've also introduced a hack to the JS binding generator that allows requesting the JSContext pointer in nim procs. Really I should just fix the union generator thing and add support for overloading. In conclusion, for now the only thing canvas can be used for is exporting it as PNG and uploading it somewhere. Also, we now have PNG encoding and decoding too. (Now if only we had sixels as well...)
* Refactor config, add charset optsbptato2023-05-161-0/+6
| | | | Only document-charset supported for now.
* what 003ca26b was supposed to dobptato2023-04-301-0/+1
|
* Update character width rangesbptato2023-02-051-168/+102
| | | | | Use the Unicode 15 EastAsianWidth.txt file instead of an ancient wcwidth implementation's ranges.