Page MenuHomePhorge

support language highlighting for GFM-style code blocks
Needs ReviewPublic

Authored by roguelazer on Mar 16 2022, 23:37.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 16, 16:37
Unknown Object (File)
Mon, Mar 13, 05:18
Unknown Object (File)
Thu, Mar 2, 08:45
Unknown Object (File)
Thu, Mar 2, 08:44
Unknown Object (File)
Wed, Mar 1, 17:13
Unknown Object (File)
Tue, Feb 21, 04:22
Unknown Object (File)
Tue, Feb 21, 04:22
Unknown Object (File)
Feb 20 2023, 21:22
Tokens
"Mountain of Wealth" token, awarded by 20after4.

Details

Reviewers
None
Group Reviewers
O1: Blessed Committers
Summary

These are very common in READMEs and makes it easier to have projects that are mirrored between github and phorge

Test Plan

Running it on our local phabricator/phorge instance

Diff Detail

Repository
rP Phorge
Branch
more-gfmy
Lint
Lint Errors
SeverityLocationCodeMessage
Errorsrc/infrastructure/markup/blockrule/PhutilRemarkupCodeBlockRule.php:51XHP5Use of Undeclared Variable
Unit
Tests Skipped
Build Status
Buildable 63
Build 63: arc lint + arc unit

Event Timeline

roguelazer edited the test plan for this revision. (Show Details)
src/infrastructure/markup/blockrule/PhutilRemarkupCodeBlockRule.php
77โ€“82

Would it make sense to put the language parsing here instead of above? Essentially if we see a key here which doesn't exist in options, whose value is empty/null, and the key matches a known syntax language then we could specify the language here.

126โ€“129

It may also make sense to update this area of the code. Possibly having the guesswork done here or at least updating the comment to clarify that this guessing should only occur if the user didn't specify lang or if we determined it was specified GFM style

Sorry but this title seems somehow cryptic to me. Are we talking about this feature?

https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks

So it seems at the moment this syntax is supported:


```lang=php
Code
```

But not this syntax:


```php
Code
```

Isn't it?