1
0
Fork 0
mirror of https://github.com/KingDuckZ/kamokan.git synced 2024-11-23 00:33:44 +00:00
Commit graph

254 commits

Author SHA1 Message Date
0372bd9dbe Update incredis to latest. 2017-06-21 08:15:26 +01:00
ec5adffb03 Bugfix - pastie page *is* pastie_page ;) 2017-06-20 21:18:47 +01:00
9f20c4885d Eat up the last newline in a pastie if present. 2017-06-19 20:22:53 +01:00
eb02bd617b Eat up the newline following the html comment. 2017-06-19 20:19:51 +01:00
9c0734c31d Use the largest int type - it should do 8 chars at time on 64-bit. 2017-06-19 19:54:06 +01:00
e649e9a196 Stock indices (1-based) in escape_bytes instead of just a flag.
The corresponding byte in escape_bytes to every to-be-escaped
characters in the source buffer gets set to the index of the
character in Needle +1. expand() is similar to slow_copy(),
except that it doesn't need to re-compare each character in
the source buffer to check if it needs to be replaced. Each
non-zero byte (that's why indices are 1-based) in parWhich
is the index of the sequence that should be used to replace the
original character (needles[curr_byte-1]).
2017-06-19 19:19:42 +01:00
6bee1af080 Fix calculations and add a test for the html escaping code. 2017-06-19 18:08:34 +01:00
3de5e3fd27 Remove test text from html. 2017-06-19 15:46:45 +01:00
b14aae1fe9 Make is_submit_page() const 2017-06-19 15:46:29 +01:00
17a5009f1f Add a pastie_page mustache token. 2017-06-19 15:45:56 +01:00
543b3bdfee Update html 2017-06-18 16:23:43 +01:00
768aefb596 Add pastie_lang mustache when submitting a self-destructing pastie. 2017-06-18 15:12:22 +01:00
9deaa8a0b8 Add default_pastie_lang() method and language_selected mustache. 2017-06-18 15:08:44 +01:00
00e27a774a Remove pastie_page token and add a submit_page one instead (bool). 2017-06-18 14:56:06 +01:00
070c814387 Bug fix - extra not 2017-06-18 14:51:40 +01:00
74fa7231b6 Custom code to escape html - is it faster than houdini? 2017-06-18 14:14:29 +01:00
583de98b76 Add colourless mustache token. 2017-06-18 02:29:11 +01:00
00c62d4ac6 Improve code that strips unwanted tags from the highlighted html.
Provide a highlight_comment mustache tag with the comment that I
stripped from the highlighted pastie.
2017-06-18 02:23:07 +01:00
1adff30ffa Off by one :( 2017-06-18 01:40:39 +01:00
e978d87b16 Temporary hack to remove html tags that are causing problems.
I will add the comment back in as as separate mustache token. And I
will make this code look a bit nicer.
2017-06-18 01:33:44 +01:00
2bc671280e Don't add html tags to colourless pasties. 2017-06-18 01:11:16 +01:00
0dd4f712a8 Warning fix for clang. 2017-06-16 21:42:43 +01:00
61170dc371 Don't redirect after submitting a self-destructing token. 2017-06-16 20:08:18 +01:00
86a576985e Rename PastieRetrieving to GeneralPastie as I think it clearer. 2017-06-16 19:17:28 +01:00
3a9a9611ac Implement EditResponse.
I can't really test this yet, but it might just work.
2017-06-16 19:12:21 +01:00
b325af980f Make a generic pastie retrieval base class.
This is useful for implementing the EditResponse class.
2017-06-16 19:02:34 +01:00
c86df2de07 Move some pastie fetching logic into Storage.
I'm implementing an "edit" page, so I also need to retrieve
a pastie from there and I want to minimize code duplication.
2017-06-16 08:11:26 +01:00
459f9682e0 Update html. 2017-06-15 00:06:47 +01:00
aeafd6daab Update incredis. 2017-06-15 00:05:36 +01:00
c34b7ba11d Make empty string count as false. 2017-06-15 00:05:27 +01:00
2a5b6277a4 Expose token and a bool to tell if it's a pastie page to mustache. 2017-06-14 21:06:45 +01:00
218e9ab6cd Add a bool to mustache to tell if a pastie got self-destructed. 2017-06-14 20:31:17 +01:00
b6edab7171 Implement self-destruct upon read when selfdes=1 in POST 2017-06-14 20:19:18 +01:00
8d19c794ed Extract string conversion functions from SettingsBag.
It's useful to have this functionality elsewhere, especially
the string to bool one which I'm going to use in the next
commit.
2017-06-14 19:30:52 +01:00
9fc9cf851c Add page_time token to mustache.
That's the elapsed time from program start to
the moment before the final invocation to
mustache rendering. So not super accurate but
that's what I can do for now.
2017-06-14 09:16:30 +01:00
131903c607 Rename TawashiException to just Exception.
It's in tawashi namespace already.
2017-06-13 09:36:53 +01:00
e5f7f60e8b Change namespace of kamokan-specific stuff. 2017-06-13 09:36:53 +01:00
a912b1e3d4 Expose Tawashi's version to mustache. 2017-06-13 09:36:12 +01:00
6c357f1dc7 Separate Tawashi and Kamokan.
Unit tests are still a bit mixed up, but that should
be simple to split once I have a separate repo for
Tawashi.
2017-06-13 09:36:12 +01:00
44350478c1 Version bump to 0.2.3 2017-06-09 00:19:33 +01:00
43e97ee79b Fix data corruption when submitting a pastie. 2017-06-08 23:38:11 +01:00
f3868e5b3f For some reason the incredis test was still enabled on this machine. 2017-06-08 22:56:35 +01:00
f6da79a49d Add an option to ignore pastie tokens that are too long.
0 disables the limit.
2017-06-08 22:02:11 +01:00
96a349bb8d Drop ?blabla before calling factory.make_response().
This fixes the problem with error.cgi?reason=... being
mistaken for a pastie.
2017-06-08 21:57:09 +01:00
5f0ea56241 Log raw pastie from POST and pastie before going to redis.
This is to hopefully track down the pastie corruption
bug that I'm only encountering on the outgoing server.
2017-06-08 21:33:18 +01:00
b5b0db8b8d Implement truncated_string().
It will either return the full string if its length was
maxlen or less, or up to maxlen characters with
a "..." appended at the end. It will also replace any
\n or \r character with a literal "\n" or "\r"
respectively. Only line breaks are being replaced, and
this happens inside truncated_string() because truncating
only makes sense to me if you want to use it to
keep stuff short and in one single line.
2017-06-08 21:32:04 +01:00
5b88afb276 Reject pastie tokens that are not in the a-z range. 2017-06-08 10:15:51 +01:00
c3609e1768 Add an array of lines and line numbers to the mustache context. 2017-06-07 21:52:55 +01:00
a56014bed8 Fix wrong code that wasn't splitting on ? correctly 2017-06-07 09:38:05 +01:00
8795977da9 Extract pastie's token manually from the request uri. 2017-06-07 00:49:44 +01:00