Highlight code blocks #645

Merged
Kieran merged 1 commits from fernandoporazzi/snort:code-highlighter into main 2023-10-09 09:10:39 +00:00
Contributor

I am not sure this is something Snort should have....

I've implemented code highlighting using fragments and regex. How will it work?

```ts
console.log("some value");
```

If there is some content starting and finishing with 3 backticks, the highlighting will be applied.

As I said, I am not sure this is desirable or a good idea considering there is a NIP for long-form content that is markdown based.

Nostr event: nevent1qqsgllkv7wc8cmpz4y4kjpwe0zyy3j2mgfx82f5rhrj982c5gsn44scppemhxue69uhkummn9ekx7mp0qgs840v084fmuuq3zdf9chzxfqhdfralfjn8nzxfhhn9az30lexr54crqsqqqqqpxkef8g

Another: nevent1qqspv3w24yw3frxzg7dj82sftpnfxhyv03a0wx2sdn74ujtwzntuvtqy8hu7u

Outcome can be found in the attachment.

I am not sure this is something Snort should have.... I've implemented code highlighting using fragments and regex. How will it work? ```` ```ts console.log("some value"); ``` ```` If there is some content starting and finishing with 3 backticks, the highlighting will be applied. As I said, I am not sure this is desirable or a good idea considering there is a [NIP for long-form content](https://github.com/nostr-protocol/nips/blob/master/23.md) that is markdown based. Nostr event: `nevent1qqsgllkv7wc8cmpz4y4kjpwe0zyy3j2mgfx82f5rhrj982c5gsn44scppemhxue69uhkummn9ekx7mp0qgs840v084fmuuq3zdf9chzxfqhdfralfjn8nzxfhhn9az30lexr54crqsqqqqqpxkef8g` Another: `nevent1qqspv3w24yw3frxzg7dj82sftpnfxhyv03a0wx2sdn74ujtwzntuvtqy8hu7u` Outcome can be found in the attachment.
Kieran approved these changes 2023-10-09 09:02:31 +00:00
Owner

Need to run formatting, you can use yarn pre:commit before commiting code and it formats everything for you

Need to run formatting, you can use `yarn pre:commit` before commiting code and it formats everything for you
fernandoporazzi force-pushed code-highlighter from 11ce81efd8 to 9c4871d3c1 2023-10-09 09:06:02 +00:00 Compare
Author
Contributor

Need to run formatting, you can use yarn pre:commit before commiting code and it formats everything for you

Applied

> Need to run formatting, you can use `yarn pre:commit` before commiting code and it formats everything for you Applied
Kieran merged commit 12723cf54b into main 2023-10-09 09:10:39 +00:00
Kieran deleted branch code-highlighter 2023-10-09 09:10:39 +00:00
Sign in to join this conversation.
No description provided.