feat: Render the document shepherd writeup templates at two new URLs#4225
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4225 +/- ##
==========================================
+ Coverage 88.20% 88.40% +0.20%
==========================================
Files 295 294 -1
Lines 39279 39202 -77
==========================================
+ Hits 34645 34656 +11
+ Misses 4634 4546 -88
Continue to review full report at Codecov.
|
jennifer-richards
left a comment
There was a problem hiding this comment.
A couple comments inline - the awkward Boolean logic in the template bugs me a bit. Maybe consider always passing type in the context instead of adding the complication of looking both at type and doc?
Also, I think this is the only place where the writeup is rendered with markdown - is that intentional? (I don't think it's rendered in the document_shepherd_writeup() view yet, but maybe I missed it?
These are just for consideration, no objection to running with it as-is.
2cce47a to
c516a61
Compare
|
@jennifer-richards, thanks for the review. I think I addressed your comments in the latest push. Yes, this is the only place where we render the template as Markdown - it only recently became Markdown, so I don't see a good way to do so when displaying submitted writeups. |
54c2324 to
711f019
Compare
|
I restored the |
|
I wonder if it would make sense to bleach |
|
Do you want it in another PR, or can I add it to this one? |
|
I'm worried about whether bleaching the input leads to a false sense of security. I haven't found recent discussions, but there seems to be a general sense that feeding markdown into bleach is not valid. I think we should probably stick to teaching bleach to allow the things we need or we're likely baking in vulnerabilities. |
|
I think adding it to this one is fine. Could you and Jennifer iterate on whether we're doing the right thing with bleach at the right place? |
|
@larseggert, Were there particular pieces of markdown formatting that bleach was still stripping? |
|
Just looked - I think the "id" attributes were being stripped from the rendered HTML: and similar for the group template. Adding the "id" attribute to the allowed attributes list in |
|
Good catch. I'll see if I can cook up a test to see if there are others. |
Those being `/doc/shepherdwriteuptemplate/group` and `/doc/shepherdwriteuptemplate/individual`.
Also rearrange the code a bit
711f019 to
30db611
Compare
|
There weren't any others, so I think this is good to go. |
Those being
/doc/shepherdwriteup-template/groupand/doc/shepherdwriteup-template/individual.CC @ghwood.