finos / messageml-utils

MessageML is a markup language used by the Symphony Agent API for representing messages, including formatting (bold, italic, numbered and unnumbered lists etc.) and entity data representing structured objects.
https://docs.developers.symphony.com
Apache License 2.0
12 stars 28 forks source link

Support language attribute in code element #326

Closed thibauult closed 2 years ago

thibauult commented 2 years ago

As a bot developer, I want to set the langage attribute from my \ block, so that the code I is highlighted correctly according to the programming language I am sending

MessageML example:

<messageML>

  <code langage="java">
    public void someMethod(String someAttribute) {
      System.out.println("This is a code block");
      System.out.println("Value of Attribute:" + someAttribute);
    }
  </code>

</messageML>

PresentationML result:

<div data-format="PresentationML" data-version="2.0"> 

  <code data-langage="java">
    public void someMethod(String someAttribute) {
      System.out.println("This is a code block");
      System.out.println("Value of Attribute:" + someAttribute);
    }
  </code>

</div>

For now the list of supported langages is:

  • plaintext
  • c
  • cpp
  • csharp
  • css
  • html
  • java
  • js
  • jsx
  • php
  • python
  • r
  • typescript
  • tsx

We need to check the langage key.