Page MenuHomePhorge

support language highlighting for GFM-style code blocks
AbandonedPublic

Authored by roguelazer on Mar 16 2022, 23:37.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 14, 19:01
Unknown Object (File)
Tue, Jun 11, 02:27
Unknown Object (File)
Tue, Jun 11, 02:26
Unknown Object (File)
Mon, Jun 10, 00:24
Unknown Object (File)
Sat, Jun 8, 09:44
Unknown Object (File)
Sat, Jun 8, 04:23
Unknown Object (File)
Sat, Jun 8, 03:31
Unknown Object (File)
Sat, Jun 8, 03:22
Tokens
"Mountain of Wealth" token, awarded by 20after4.

Details

Summary

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

Closes T15481

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?

Hi @roguelazer are you still interested in this feature? In 3 days, hoping to be useful, I will try to do something similar, following the tips from kind user speck

Thank you very much for this change. Hoping to be useful I tried to follow the indications from speck here:

D25299

Hi @roguelazer - note that now D25299 is quite usable now. Your feedback would be really welcomed also there! :)

In the meanwhile I flag this as "Request Changes" since we are missing important unit tests and additional checks to do not eat legitimate Remarkup :( mainly because interestingly Remarkup was quite more "advanced" than we thought here.

This revision now requires changes to proceed.Jun 26 2023, 15:25

🎉 This feature landed master with the following implementation:

D25299: Remarkup Code-block: parse language specifier in markdown

So the Diff D25034 can be flagged as Abandoned or something similar.

valerio.bozzolan edited reviewers, added: roguelazer; removed: valerio.bozzolan.

(I will do some mess to flag as closed/abandoned)

valerio.bozzolan foisted this revision upon roguelazer.
valerio.bozzolan edited reviewers, added: valerio.bozzolan; removed: roguelazer.