Skip to main content



      Home
Home » Eclipse Projects » Mylyn » Info strings in code blocks
Info strings in code blocks [message #1824161] Wed, 08 April 2020 16:10 Go to next message
Eclipse UserFriend
Hello,

When I try to generate HTML from Markdown using the minimal code below, I would expect the generated <code> element to have a class="language-java" attribute as per [1], which doesn't seem to be the case. Any thoughts on whether this is possible and what I'd need to set/override to make this happen would be much appreciated.

MarkupParser markupParser = new MarkupParser();
markupParser.setMarkupLanguage(new MarkdownLanguage());
System.out.println(markupParser.parseToHtml("```java\nreturn 0;\n```"));


Thanks,
Dimitris

[1] https://spec.commonmark.org/0.21/#example-98
Re: Info strings in code blocks [message #1824167 is a reply to message #1824161] Wed, 08 April 2020 18:48 Go to previous messageGo to next message
Eclipse UserFriend
Hi Dimitris

The Markdown component does not support the full CommonMark spec. It was designed with the original spec in mind, and has had only minor additions made to support a few of the more popular CommonMark features.

There is a separate CommonMark component in incubation that you could try, and I believe it supports the class element in fenced code blocks. The caveat is that the CommonMark component has not been in development in a few years and I'm not sure how feature complete it got.

Cheers,
Leo
Re: Info strings in code blocks [message #1824178 is a reply to message #1824167] Thu, 09 April 2020 02:28 Go to previous message
Eclipse UserFriend
Hi Leo,

Thank you for your response. A bit more digging has revealed that this was actually fixed a few months ago [1, 2] and works fine with the latest version of WikiText.

Cheers,
Dimitris

[1] https://git.eclipse.org/c/mylyn/org.eclipse.mylyn.docs.git/commit/?id=1ef45a3c78183d3664af44957306c35e619b11cf
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=558314
Previous Topic:sorting tasks by id
Next Topic:Mylyn update error
Goto Forum:
  


Current Time: Thu May 22 23:14:33 EDT 2025

Powered by FUDForum. Page generated in 0.06995 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top