cmark-gfm's behavior seems to have changed when I upgraded it, and it's
now producing " entities instead of normal double-quote characters.
This was breaking syntax-highlighting, so this simply replaces all the
entities back to normal double-quotes. This is maybe a little risky to
do without doing it as part of proper HTML parsing, but I think it
should overall be pretty safe.
Saying "posts" when the user might have bookmarks of the other type
(topics/comments) wasn't quite right, so this just makes it more
specific and fixes up the related post_type code a little.
Pagination isn't working correctly for bookmarks yet, and it seems like
it'll take some fiddly work to be able to make PaginatedQuery be able to
handle using the bookmark's created_time instead of the post's.
This just simplifies the method by using an inner join on the bookmarks
instead of an EXISTS subquery, and totally removes pagination for now.
Bleach supports adding html5lib filters to the cleaning process, which
is how its linkify() process works, as well as being how I implemented
the custom Tildes linkification for usernames and group names.
This commit switches to adding those filters into the clean() call,
which makes it so everything is now done in a single pass instead of
three. In addition, this also fixes the issues we were having with
bleach "fixing" things that it thought were invalid HTML (when they were
just people writing things inside angle brackets).
Continuing on with the theme-system overhaul, this adds some more
definable colors, some more "fallback" logic, and moves Solarized colors
into a particular theme file instead of using them throughout the CSS.
Solarized colors are still used in the base theme, but all are hardcoded
and labeled as such, so that they can be spotted/replaced more easily.
This replaces the previous CSS theme system with a new one based around
using SCSS map-merge to define different "color sets" that can overwrite
the base theme to generate new themes.
The original theme system was heavily based around Solarized with only
light and dark variants, and other themes weren't able to replace many
of the colors (link colors, buttons, alerts, etc.). This new system will
make it possible to have themes that are completely unrelated to the
Solarized variants.
Of course right after I did that last update, they released two more new
versions of cmark-gfm, so here we go again.
The .18 update defaults to "safe" mode, but I want to disable that and
leave sanitization up to Bleach, so this required changing the options.
Previously, search only covered topic titles and markdown. This adds
tags to it as well, and will make it easier to add other things in the
future since there's now a custom function instead of using the built-in
one that only supports text columns.
mypy 0.640 has made it so that it's no longer necessary to annotate the
return type for __init__ methods, since it's always None. The only time
it's necessary now is if the method doesn't have any arguments, since
this shows that the method should still be type-checked.
Previously, there were a number of issues coming up repeatedly related
to unexpected behavior of nested lists and similar cases. This is
because we're trying to use lists for their semantic value occasionally
(such as for lists of topics inside a particular group), but the default
styles (including the ones from Spectre.css) have set them up
specifically for text-based lists.
This commit addresses this by changing the base ol/ul styles back to
something very neutral (no margins or marker for list items), and then
adding a specific "placeholder class" that can be extended in places
that will have text-based lists, like inside comment or topic text.
Something strange is going on with this package - after no updates for 2
years it's suddenly had two new versions released without having its
changelog updated, and the new versions don't seem to work properly. You
can no longer import it as "publicsuffix" like you used to be able to,
and it appears that the newest version (2.20180921.2) no longer even
downloads the publicsuffix file, it just uses the one included in the
package.
Bleach is in the middle of being updated to a significant new version
that seems to have quite a few changes (and will probably be a good
update overall that will fix some issues on Tildes), however right now
there are a few things still off with it and it's not safe for me to
update to it yet.
Updates the Black code-formatter to its newest version and applies it.
They made some small changes to how it handles numeric literals that
affected a few files - both always forcing a "0." prefix on float values
instead of allowing an implicit "0" to be there, as well as only adding
underscore separators if the number has at least 6 digits.
We're always using lowercase for all ltree usages (group paths, topic
tags), so it's best to just have the Ltree field do this conversion.
This fixes some minor issues like tag-filtering not working if the
casing of the tag was wrong.
A few other changes needed to be made as part of this, in places where I
was inadvertently passing an Ltree value into the Ltree field, instead
of a string.
Deleted comments weren't collapsing properly, since this wasn't
attaching the classes even if the comments were collapsed by one of the
CommentTree processes.
Uncollapsing the new comments' parents wasn't working correctly if there
were several new replies in a chain. Because it's working from the
"leaf" comments back up towards the root, doing a continue when a
comment's state had already been set would cause uncollapsing parents to
fail - the deepest comment would uncollapse its parent, then its parent
would get skipped. If the parent was also new, this would mean that
*its* parent didn't get uncollapsed, even though it should have been.
The ago library doesn't handle datetimes correctly if they have any
timezone except the system's localtime. This can be worked around by
calculating a timedelta and passing that instead of a datetime. This
commit updates the descriptive_timedelta() function to do that.
I've also registered an issue on the library, but I don't know if it's
maintained any more:
https://bitbucket.org/russellballestrini/ago/issues/3
Previously, TopicListingSchema was being used for things that weren't
listings of topics. So this creates a more generic
PaginatedListingSchema and makes TopicListingSchema a subclass of it
that adds the additional fields it needs.
This has said that pagination is "coming soon" for quite a while. This
is a bit messy in a few ways, but should do the job for now.
PaginatedQuery/PaginatedResults might be good to refactor a little in
the future to make this kind of thing simpler.
Automatically runs the generate-site-icons script every 5 minutes. The
script was also updated to use checksum-based rsync instead of cp, so
that the file won't be replaced (and need to be redownloaded by users)
unless it actually changes.
This adds a trigger to the scraper_results table which will add rabbitmq
messages whenever a scrape finishes, as well as a consumer that picks up
these messages, and uses Embedly data to download (and resize if
necessary) the favicons from any sites that are scraped. These are
downloaded into the input folder for the site-icons-spriter, so it
should be able to use these to generate spritesheets.