Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Mylyn » Info strings in code blocks
Info strings in code blocks [message #1824161] Wed, 08 April 2020 20:10 Go to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2056
Registered: July 2009
Location: York, UK
Senior Member

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 22:48 Go to previous messageGo to next message
Leo Dos Santos is currently offline Leo Dos SantosFriend
Messages: 27
Registered: July 2009
Junior Member
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 06:28 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2056
Registered: July 2009
Location: York, UK
Senior Member

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: Sat Oct 01 15:50:27 GMT 2022

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

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

Back to the top