Support for Syntax Highlighting in Emails from JIRA
Testing using JIRA Syntax Highlighter Plugin v1.9, "code" wiki markup not provide syntax highlighting in email notifications.
It would be useful for Syntax Highlighting to work in JIRA email notifications - it works fine for Atlassian's own "code" markup.
Tested using gherkin, CSS, and SQL code markup (although Atlassian only supports SQL).
Comments (15)
-
repo owner -
reporter Syntax Highlighting may be performed client-side. However it is done, the highlighting works when emails are generated from JIRA without using the Syntax Highlighting Plugin... ie, wiki markup done using Atlassian's built in wiki renderer.
Attached screenshot shows that rendering works well when viewed in Firefox, and also within Microsoft Outlook client (which would use Internet Explorer to render).
-
repo owner -
assigned issue to
- changed milestone to 2.0.0
I am currently working on a major change switching from JavaScript/client side to Java/server side syntax highlighting. This will fix
#42,#48(problems with certain browser versions),#44(syntax highlighting in activity streams) and#45(syntax highlighting in emails),#46and#47(interference with other plugins like Links Hierarchy and JEMH using regex JS lib).Would you be able to test a beta release of this plugin?
-
assigned issue to
-
repo owner - changed status to open
-
repo owner Version 2.0.0-beta1 is now available for download here.
It contains implementation for
- syntax highlighting in emails
- syntax highlighting in activity streams
- has support for collapse parameter
- switches to line numbers not being shown by default
- layout is now similar to Confluence
Sample with all features of JIRA Syntax Highlighter Plugin incl. line numbers, first line, highlight and title. (Only collapse is not shown here).
{code:java|linenumbers|firstline=5|highlight=7,8-9|title=Example for HelloWorld.java} // Hello World in Java class HelloWorld { static public void main( String args[] ) { System.out.println( "Hello World!" ); } } {code}
This will be rendered as shown in the following screenshot.
Please raise an issue here, if you find any problems or bugs.
Currently brushes for Objectiv-C, TCL, Gherkin and D are missing, but will be delivered as part of 2.0.0-beta2 resp. the final release.
Best regards, Holger
-
repo owner Would be great if you could provide a sceenshot from Outlook similar to the one above. Hopefully with correct syntax with this beta release. :-)
Cheers, Holger
-
reporter I am running 2.0.0-beta1 on JIRA v6.3.1. So far, everything seems great with syntax highlighting in the activity stream. However, things are not working in Outlook 2013 or in Office 365. I performed a couple of tests. One for SQL, and one for the example you gave above:
-
repo owner Can you check, how this is rendered, when JIRA Syntax Highlighter is disabled? Looks like plugin is not used at all in this screenshot. Maybe {code...} is escaped with \{code...} by accident? Or WikiRenderer disabled for comments? Also [~marks] is not rendered properly (should be replaced by user name - see screenshot from 2014-05-30).
-
reporter I have done some digging and it seems that there seems to be a problem with issuecommentedited.vm. Thus, when Syntax Highlighter code module is disabled and the Atlassian Wiki Renderer plugin's code module is enabled then there is still a problem with the rendering in emails. It looks like my 2.0.0-beta1 screenshot above.
When I add a comment (instead of editing an existing comment) then the email is rendered whether using either Syntax Highlighter plugin or the Atlassian plugin.
Is this something that should be logged as a defect in JAC, and if so, do you want to do it or shall I?
I have not yet iterated through the other templates: created, resolved, reopened, etc.
Here is a screenshot for "issue commented". Note that things are looking pretty good - but the highlight has not worked & there's a spacing issue with the line numbering.
-
reporter I've searched around. This seems to be the defect in JAC for issue comment edited: JRA-37674
-
repo owner Many thanks for checking this issue. I put my vote on JRA-37674. :-)
For other emails could you please check syntaxplugin-2.0.0-beta2.jar? I have changed some things in the HTML layout.
Cheers, Holger
-
repo owner Proper rendering in email clients is really tricky. While I could fix background-color and font-color issues, I still have problems with margin and padding. Guess I need to use https://www.campaignmonitor.com/testing/ or similar services...
-
reporter If background-color and font-color are fixed then margin and padding could probably be put aside for now and looked at later. That would allow a quicker release of v2.0 of the plugin... which is looking pretty darn good. I am looking forward to being able to deploy it on my production system when it's made available.
-
repo owner - attached beta4-Gmail.png
- attached beta4-Outlook com.png
- attached beta4-Outlook 2013.png
- attached beta4-Outlook 2010.png
- attached beta4-Notes 8.png
- attached beta4-iPhone 5s.png
- attached beta4-Android 4.png
Attached some test screenshots of 2.0.0-beta4 created via Champaign Monitor. * Outlook 2010 and 2013 has padding and some border problems * Outlook.com looks very strange; hope this is a problem at Champaign Monitor and not of Outlook.com
-
repo owner - changed status to resolved
Done.
- Log in to comment
This is currently not possible, because syntax highlighting is done on client side using JavaScript by the browser and this approach is not possible in emails.
To make this possible a complete redesign and a switch to server side highlighting would be needed.
I leave this ticket open to gather additional feedback.