be more aggressive about assuming plain-text, use remarkup for no extension, .remarkup, and .md, and last but not least use rainbow for .rainbow. Fixes T5818.
Details
- Reviewers
epriestley - Maniphest Tasks
- T5818: Unrecognized `README.xyz` files are rendered as remarkup
- Commits
- Restricted Diffusion Commit
rPc1e8d97069fa: Diffusion - re-jigger how README files get rendered
my README rendered just fine post these changes
Diff Detail
- Repository
- rP Phabricator
- Branch
- T5818
- Lint
Lint Passed Severity Location Code Message Advice src/applications/diffusion/conduit/DiffusionReadmeQueryConduitAPIMethod.php:127 XHP16 TODO Comment - Unit
No Test Coverage - Build Status
Buildable 2335 Build 2339: [Placeholder Plan] Wait for 30 Seconds
Event Timeline
Oh, hmm...
src/applications/diffusion/conduit/DiffusionReadmeQueryConduitAPIMethod.php | ||
---|---|---|
80–84 | Oh -- do we get this wrong? That is, if we have README.rst and also README.remarkup, is it possible we'd render one with the wrong rendering type? |
src/applications/diffusion/conduit/DiffusionReadmeQueryConduitAPIMethod.php | ||
---|---|---|
81–83 | That is, I'd expect we need something like: $best_render_type = $render_type; ...here, and then to use $best_render_type below. |
src/applications/diffusion/conduit/DiffusionReadmeQueryConduitAPIMethod.php | ||
---|---|---|
49 | This change doesn't seem correct? Files without an extension are generally going to be plain text - and appear to conflict with "be more aggressive about assuming plain-text". |
Rendering actual plain text as remarkup is fine. It basically just gets links linked up, which is good.
It's only a problem when the text is formatted as something else and then we try to render it as remarkup and everything gets all terrible.
I'd be fine with rendering "README" (i.e., no extension) as plain text too, but not having links clickable seems slightly worse than what we generate from plaintext documents I've seen. If I'm wrong and some reasonable subset of no-extension files are actually terrible when rendered as remarkup we can/should change the rule to assume ".txt" from "README".