yours-truly-phil / codey Goto Github PK
View Code? Open in Web Editor NEWDiscord bot to compile and run code, all without leaving discord and just a single click away.
License: GNU General Public License v3.0
Discord bot to compile and run code, all without leaving discord and just a single click away.
License: GNU General Public License v3.0
Just saw some code blocks that looked like valid java code but I didn't see the โจ reaction added to it from the CodeFormatter.
Turns out, I didn't know that it's valid to start the content of a code block in the line of the ```. I always expected either the three ``` and a newline or the three ```, then some text (like 'java', 'cpp', etc.) which is the language attribute and then a newline.
I need to be able to recognize whether or not the first word in a codeblock is the language attribute, so I'm looking for a list with shorthands for all supported languages.
So I'm thinking I will either use a comprehensive list like https://github.com/github/linguist/blob/master/lib/linguist/languages.yml to parse the language attribute, or create my own list with all the languages the bot actually supports, which as of now would be just ["java"].
I'm both looking into https://github.com/vsch/flexmark-java and https://github.com/atlassian/commonmark-java
So far, both don't do what I expect:
It's odd that neither of them recognizes the end of the codeblock if trying to parse:
"""
Hello, what's going on,
now comes a code block:
```java
I'm inside the code block
hooray!```
I come after the code block"""
The result after parsing for both libraries is one Paragraph that contains two children:
First child: "Hello, what's going on,"
Second child: "now comes a code block:"
The a second node of type FencedCodeBlock with one child spread over three lines:
Line 1 of FencedCodeBlock: "I'm inside the code block\n"
Line 2 of FencedCodeBlock: "hooray!```\n"
Line 3 of FencedCodeBlock: "I come after the code block"
I expected to have a Paragraph, then a code block and then another paragraph after the codeblock and no ' ```' as part of the content.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.