1
0
mirror of https://github.com/e621ng/dtext_rb.git synced 2025-03-04 03:03:03 -05:00
Commit Graph

290 Commits

Author SHA1 Message Date
Earlopain
5ef8fd7a52
Regenerate cpp 2023-04-09 12:54:16 +02:00
Earlopain
76de82ff2b
Surround section content in div
Makes it easier to style
2023-04-09 12:53:59 +02:00
Earlopain
1daa661880
Unify section open 2023-04-09 12:47:57 +02:00
Earlopain
67a764bab0
Use class methods 2023-04-09 12:47:08 +02:00
Earlopain
a53e86aae9
Fix <summary> not being considered a block 2023-04-08 15:21:58 +02:00
Earlopain
843938681c
Merge pull request #6 from e621ng/danbooru-catchup
Danbooru catchup
2023-04-08 13:46:31 +02:00
Earlopain
d01befd873
Regenerate dtext.cpp and bump version 2023-04-03 13:40:33 +02:00
Earlopain
efc5e6c0e5
Switch to standard gem layout
Part of c5bc7d1629

Co-Authored-By: evazion <noizave@gmail.com>
2023-04-03 12:55:51 +02:00
Earlopain
cff99d7350
Define as class instead of module 2023-04-03 12:51:59 +02:00
Earlopain
4b08af9d09
Improve parsing of [color] when color is disabled
There are still issues. Headers don't get displayed correctly because
it's in inline mode, not main.
2023-04-02 22:43:20 +02:00
Earlopain
23f49dc8d9
Respect color permissions in reference comparison 2023-04-02 21:53:42 +02:00
Earlopain
4db1b51929
Use consistent convention for end of string pointers
b4fd563656

Co-Authored-By: evazion <noizave@gmail.com>
2023-04-02 21:16:11 +02:00
Earlopain
f963fbaebd
Restrict allowed characters for internal anchors
Part of 8cc295d1ea

Co-Authored-By: evazion <noizave@gmail.com>
2023-04-02 18:38:12 +02:00
Earlopain
6bca822ba7
Fix closing quote preceded by a header
Part of 9f9c89800c

Co-Authored-By: evazion <noizave@gmail.com>
2023-04-02 18:15:52 +02:00
Earlopain
20df809280
Simplify <hX> generation
8cc295d1ea

Co-Authored-By: evazion <noizave@gmail.com>
2023-04-02 16:58:36 +02:00
Earlopain
6f2f8eac2e
Remove header_with_id
e6 uses another syntax for this
2023-04-02 16:40:29 +02:00
Earlopain
4cf73756ef
Fix unclosed tags inside headers
fcc2081127

Co-Authored-By: evazion <noizave@gmail.com>
2023-04-02 14:21:30 +02:00
Earlopain
f0b016d5df
Close open tags before [table] or [code]
a7e736f005

Co-Authored-By: evazion <noizave@gmail.com>
2023-04-02 13:33:18 +02:00
Earlopain
ccec0eb3c4
Fix headers to not require blank line above
4de82a0436

Co-Authored-By: evazion <noizave@gmail.com>
2023-04-02 13:15:51 +02:00
Earlopain
7fa785f4b2
Prevent list items from spanning muliple lines
285e401278

Co-Authored-By: evazion <noizave@gmail.com>
2023-04-01 19:39:27 +02:00
Earlopain
33c97f1e9a
Fix block [spoiler] tag to close open inline tags
98f21f83b9

Co-Authored-By: evazion <noizave@gmail.com>
2023-04-01 14:58:07 +02:00
Earlopain
50a908835e
Fix block [quote] tag to close open inline tags
bfc166b5a0

Co-Authored-By: evazion <noizave@gmail.com>
2023-04-01 14:56:20 +02:00
Earlopain
e13e02f138
Fix [quote] tag to close open tags
27f4de9e62

Co-Authored-By: evazion <noizave@gmail.com>
2023-04-01 14:45:38 +02:00
Earlopain
ec22c6b91a
Fix parsing of unexpected [/section] tags
d095ab1bd0

Co-Authored-By: evazion <noizave@gmail.com>
2023-04-01 13:43:07 +02:00
Earlopain
67062a87ab
Fix parsing of unexpected [/quote] tags
1bfffe0e40

Co-Authored-By: evazion <noizave@gmail.com>
2023-04-01 13:24:52 +02:00
Earlopain
075a189eef
Fix extraneous <br> tags in front of closing block tags
f411a14721

Co-Authored-By: evazion <noizave@gmail.com>
2023-04-01 13:16:43 +02:00
Earlopain
422e3a9bc4
Fix [section] tag to close open tags
c0c5b57f3e

Co-Authored-By: evazion <noizave@gmail.com>
2023-04-01 00:27:19 +02:00
Earlopain
8307adcc99
Remove mention special handling
Mentions are removed, this serves no purpose
2023-03-31 23:47:28 +02:00
Earlopain
f31a1feee2
Remove hardcoded string offsets
Makes it possible to use the same block for every section open
2023-03-31 23:39:16 +02:00
Earlopain
ec1a7ddf8c
Remove [tn]
Two total usages.
This isn't a secret table element, it probably stands for translators note.
2023-03-31 23:21:36 +02:00
Earlopain
b3ef8b8f1c
More efficient full test script
Turns out the previous version was slow af
From 2m4s to 31s for reading/parsing the whole reference file
2023-03-31 22:36:07 +02:00
Earlopain
c6cd30d7bc
Fix lists incorrectly closing previous tags
6627c65b9e

Co-Authored-By: evazion <noizave@gmail.com>
2023-03-31 19:10:03 +02:00
Earlopain
8ea08a5285
Convert StateMachine to class
Last part of 9e46b3e806

Co-Authored-By: evazion <noizave@gmail.com>
2023-03-29 22:12:53 +02:00
Earlopain
641cb9c466
Use std::exception for control flow
Part of 9e46b3e806

Co-Authored-By: evazion <noizave@gmail.com>
2023-03-29 21:11:54 +02:00
Earlopain
2490bf6284
Use separate struct for holding options
Part of 9e46b3e806

Co-Authored-By: evazion <noizave@gmail.com>
2023-03-29 20:15:20 +02:00
Earlopain
4f2d3e078c
Remove last vestiges of GLib
c8510b5e0c

Co-Authored-By: evazion <noizave@gmail.com>
2023-03-29 19:28:02 +02:00
Earlopain
dbcdfe61aa
Refactor to remove append_segment, append_block_segment
c44d73377e

Co-Authored-By: evazion <noizave@gmail.com>
2023-03-29 17:28:59 +02:00
Earlopain
9d0d629c96
Remove more GLib-isms
07ed8cba86

Co-Authored-By: evazion <noizave@gmail.com>
2023-03-29 17:18:26 +02:00
Earlopain
06f14e8be2
Refactor HTML escaping to not use GLib
94ab66648a

Co-Authored-By: evazion <noizave@gmail.com>
2023-03-29 17:09:30 +02:00
Earlopain
bb8a7856f0
Refactor URL escaping to not use GLib
2defa2f62b

Co-Authored-By: evazion <noizave@gmail.com>
2023-03-29 16:54:48 +02:00
Earlopain
6e76ea1c0b
Fix lowercasing of unicode wiki/post links
We have a few old links where this is the case.
New tags aren't allowed to contain these chars.

0571251616

Co-Authored-By: evazion <noizave@gmail.com>
2023-03-29 16:31:20 +02:00
Earlopain
eb8a00ef57
Ignore compiled output for vscode searches 2023-03-29 15:46:52 +02:00
Earlopain
d10ed92e12
Remove unused DText.parse_inline
Simply pass the inline kwarg to DText.parse
2023-03-28 22:42:29 +02:00
Earlopain
668f84206c
Test dtext error message
Turns out the gsub in preprocess_for_tables already checks valid utf8 for us.
The only thing that isn't getting checked are null bytes, that has to happen
separately
2023-03-28 22:42:14 +02:00
Earlopain
5fcd31e4e3
Convert code to C++
Convert the majority of the code from GLib to standard C++ strings and vectors.

d83cf0e2ff

Co-Authored-By: evazion <noizave@gmail.com>
2023-03-28 22:02:17 +02:00
Earlopain
418fe5a6f9
Remove need for thumbnails_left
Contains parts from 65a02be3d3
2023-03-28 19:50:52 +02:00
Earlopain
3af76a4703
Optimize append_segment_uri_escaped
Eliminate two unnecessary string allocations in append_segment_uri_escaped.
As a side effect, Unicode characters in URL parameters are now percent-encoded.

36031e0ff5

Co-Authored-By: evazion <noizave@gmail.com>
2023-03-27 21:07:31 +02:00
Earlopain
86f7d2308a
Use -G2 option to generate Ragel parser
5529b7c641

Co-Authored-By: evazion <noizave@gmail.com>
2023-03-26 23:11:02 +02:00
Earlopain
feca366bf7
Switch to building extension with C++
Switch to compiling the extension as C++. This way we can work towards replacing all the low-level C
code with C++, which is better at dealing with strings, and has a better standard library we can use
to replace the dependency on GLib.

d47307f2ef

Co-Authored-By: evazion <noizave@gmail.com>
2023-03-26 22:48:36 +02:00
Earlopain
014220bc38
Simplify parsing of Unicode characters in links
It turns out we don't need this UTF-8 character parser because we validate that the whole input is
valid UTF-8 before parsing it.
de6ab8b44a

Co-Authored-By: evazion <noizave@gmail.com>
2023-03-26 22:37:45 +02:00