~bigbes/sr-ht-spec

ref: 5b2fa22879bf5fe9b36c2bbc633de4e69f6ffa75 sr-ht-spec/doc/review.go -rw-r--r-- 12.9 KiB
5b2fa228 — Eugene Blikh a day ago
doc: say which of the three guards on the review renderer is load-bearing

The file claimed that aligning the review renderer with the read one would let a
<script> run. Mutation says otherwise: putting html.WithUnsafe() back turns
nothing red, because the raw-HTML node renderer intercepts those node kinds and
the resolver strips a dangerous destination before goldmark's own check would.
Both of those ARE load-bearing — removing them turns six and three tests red
respectively, the wikilink among them. Unsafe stays off as the backstop, and the
comment now says that instead of overstating it.
644d2686 — Eugene Blikh a day ago
doc: render a proposed document with unsafe HTML off

The read plane turns goldmark's unsafe mode on because its documents are
approved; on the review page approving them is what the page is for, so a
<script> would run in the reviewer's session while they decide. A second
renderer keeps unsafe off, shows raw HTML as escaped text rather than omitting
it (a review page must not hide part of what it asks to approve), refuses a
dangerous wikilink destination the package's own anchor writer would otherwise
emit unchecked, and carries a word diff's marks through a markdown rendering
with Private Use Area sentinels, refusing the rendering when a mark did not
survive it.