github: shadowy octopus with the head of a robot, emblazoned with the Dreamwidth swirl (Default)
github ([personal profile] github) wrote in [site community profile] changelog2020-04-20 02:22 pm

[dreamwidth/dw-free] a37fc5: Cleanup: Make return values of ljuser functions mo...

Branch: refs/heads/master
Home: https://github.com/dreamwidth/dw-free
Commit: a37fc56de9e8cb7eaca0a8c0ee9b5d00f802e45e
https://github.com/dreamwidth/dw-free/commit/a37fc56de9e8cb7eaca0a8c0ee9b5d00f802e45e
Author: Nick Fagerlund <nick.fagerlund@gmail.com>
Date: 2020-04-20 (Mon, 20 Apr 2020)

Changed paths:
M cgi-bin/DW/External/User.pm
M cgi-bin/LJ/User/Display.pm

Log Message:
-----------
Cleanup: Make return values of ljuser functions more legible


Commit: 5dde9b2cdca1f1aa8c58a869277160f7afd8d8a0
https://github.com/dreamwidth/dw-free/commit/5dde9b2cdca1f1aa8c58a869277160f7afd8d8a0
Author: Nick Fagerlund <nick.fagerlund@gmail.com>
Date: 2020-04-20 (Mon, 20 Apr 2020)

Changed paths:
M cgi-bin/LJ/CleanHTML.pm

Log Message:
-----------
Cleanup: Consolidate usertag options handling in html cleaner

- Only pass relevant options to the wrappers and the usertag functions, instead
of relaying the whole pile of cleaner options.
- Relatedly, stop storing that "inside a link" flag in the cleaner opts.
- Found one last spot that was calling ljuser directly instead of using the
wrapper function!


Commit: 403dc5d656008a8e31b45579693e7f1070a56de6
https://github.com/dreamwidth/dw-free/commit/403dc5d656008a8e31b45579693e7f1070a56de6
Author: Nick Fagerlund <nick.fagerlund@gmail.com>
Date: 2020-04-20 (Mon, 20 Apr 2020)

Changed paths:
M cgi-bin/LJ/CleanHTML.pm

Log Message:
-----------
HTML cleaner: new preserve_lj_tags_for option to keep users and cuts

This can be either a falsy value or a site hostname. (Or I guess it could be
"1", if you don't care about the user tags.) If passed to `clean` or
`clean_event`, it changes the following tag behaviors:

- `[Unknown site tag]` and `[Unknown site tag]` -- if the "site" attribute is present and it matches the
`preserve_lj_tags_for` hostname, print a native `[profile] user` tag instead
of a decorative span. (This also affects `[Bad username or site: user @ site]` mentions.)
- `` and `` -- print a normalized `` tag. If
any cuts are still open at the end, explicitly close them to make sure the
crosspost footer displays properly.

This will be useful in the crossposter.


Commit: 1978d87be096574d045178cf3022cdcc76c3266d
https://github.com/dreamwidth/dw-free/commit/1978d87be096574d045178cf3022cdcc76c3266d
Author: Nick Fagerlund <nick.fagerlund@gmail.com>
Date: 2020-04-20 (Mon, 20 Apr 2020)

Changed paths:
M cgi-bin/DW/External/XPostProtocol/LJXMLRPC.pm

Log Message:
-----------
Crossposter: Fix bustage, de-dupe, rule all formatting with an iron fist

The LJ-alike crossposter broke during the original "better markdown" patch, and
tbh a minimal fix seemed harder than just going scorched earth on it.

So now we're just running `LJ::CleanHTML::clean_event` on the text (preserving
user/cut tags) and force-setting `opt_preformatted` at the destination. Which
hopefully gains us the following:

- Maintainers don't have to Know Things about how LJ autoformatting works.
- Crossposter doesn't have to Know Things about how to distinguish and handle
our various formatting dialects. That can all live 100% in the cleaner.
- Markdown works in crossposts again.
- `[personal profile] mentions` now work consistently in crossposts.

This commit also axes the crossposter's whole second-pass HTML parser, since the
cleaner can just handle all that during the first pass now.

(And whither the `` tag? Not relevant anymore, since it only affects autoformatting and we just processed all the autoformatting out before sending the crosspost over.) Commit: 473227bb9205fe9dca0c495397ab7a7d19c1ef02 https://github.com/dreamwidth/dw-free/commit/473227bb9205fe9dca0c495397ab7a7d19c1ef02 Author: Nick Fagerlund <nick.fagerlund@gmail.com> Date: 2020-04-20 (Mon, 20 Apr 2020) Changed paths: M cgi-bin/LJ/CleanHTML.pm Log Message: ----------- Remove some dead code This can never run. I eventually tracked it to a Brad commit from 2006. https://github.com/apparentlymart/livejournal/commit/fa26ab6325e2b321430bc29736fdfe53f44a3811 Commit: 5cc786dee0fd82f80eab42c8cf8cf8a99f7bad77 https://github.com/dreamwidth/dw-free/commit/5cc786dee0fd82f80eab42c8cf8cf8a99f7bad77 Author: Nick Fagerlund <nick.fagerlund@gmail.com> Date: 2020-04-20 (Mon, 20 Apr 2020) Changed paths: M cgi-bin/LJ/CleanHTML.pm Log Message: ----------- Remember to escape the cut text attribute Compare: https://github.com/dreamwidth/dw-free/compare/8177ed01cf8f...5cc786dee0fd