Code Monkey home page Code Monkey logo

simpleast's Issues

[Feature] Add support for ANSI colors

Desktop supports Code block highlighting for ANSI colors, which is great for formatting large blocks, especially for spicing up embed fields
image
But the same stuff isn't available on iOS/Android
image

Any way this could be added?

Add Textmate config support for code block languages

Instead of manually adding languages as described in #18. For future language support, we should have a means to read in TextMate language files, and build the language rules.

The initial support is a hack week project so it was scoped down to just add support ASAP and the basic foundations of parsing out a CodeNode

Regex patterns

I apologize if this isn't the place to ask for this, but where can i find all the regex patterns discord uses to detect bold, italics, etc?

Markdown code block rendering problem on Android

Problem

When I send a message where the first characters, in the first line, in a code block, is whitespaces, like this:

```
          Some Text
          More Test
```

Then the prepended whitespaces is removed from the first line, when displayed on Android and message looks like this:

Some Text
          More Test

On Discord Desktop and iOS app, the same message is rendered the way I would expect it:

          Some Text
          More Test

A Wild Guess Appears

I tested this markdown code block regex, but the matching seems to work correctly:

  • The first group (optionally) matches the language ( line 298 val language = ... )
  • The second group has all the lines in the code block, including all the prepended whitespaces ( line 299 val codeBody = ... )

So my suspicion is that codeBody is trimmed (removing all prepending- and appending whitespaces, newlines etc.) later on. That would explain why it only happens on the first line of the code block.

But the only use of trim() I can find is in MarkdownRules.kt in a override fun parse() function:

val classes = matcher.group(2)?.trim()?.split(' ')

..and I have zero idea if it's related in any way.

There is also the possibility that this bug is outside of SimpleAST .. ?

Improve XML code highlighting

The Code highlighting for the XML language is kinda odd looking, when compared to the desktop equivalent.

On mobile does it look like that right now (I use AMOLED Dark theme):
image

Meanwhile on Desktop (Windows) is it rendered like this:
image

It bothers me, that indend ending sections, like the </block> in our example, have a completely different text fill color, while all the other ones seem perfectly fine.
This should be corrected to have it more similar to the desktop version of the App.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.