-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[jira] Convert description to markdown #415
Conversation
The description of an issue is now converted to markdown before we render the description. This is necessary because Jira returns the description in a wiki markup format, which doesn't look good when it is directly passed to the ReactMarkdown component for rendering. We also changed the logic to display the details of an issue, so that only the fields which are relly available are displayed in the details. This means if for example an issue doesn't have subtasks we do not display the subtasks section anymore. We also changed the color of the status label, so that the label matches the color in Jira. The previously used color field seems to be deprecated and Jira only allows 3 status categories. For these categories we set the color: "Done" -> "green", "In Progress" -> "blue" and "Open" -> "grey".
.replace(/~([^~]*)~/g, '<sub>$1</sub>') | ||
.replace(/(\s+)-(\S+.*?\S)-(\s+)/g, '$1~~$2~~$3') | ||
.replace( | ||
/\{code(:([a-z]+))?([:|]?(title|borderStyle|borderColor|borderWidth|bgColor|titleBGColor)=.+?)*\}([^]*?)\n?\{code\}/gm, |
Check failure
Code scanning / CodeQL
Inefficient regular expression
.replace(/^bq\.\s+/gm, '> ') | ||
.replace(/\{color:[^}]+\}([^]*)\{color\}/gm, '$1') | ||
.replace(/\{panel:title=([^}]*)\}\n?([^]*?)\n?\{panel\}/gm, '\n| $1 |\n| --- |\n| $2 |') | ||
.replace(/^[ \t]*((?:\|\|.*?)+\|\|)[ \t]*$/gm, (match, headers) => { |
Check failure
Code scanning / CodeQL
Inefficient regular expression
|
||
return str | ||
.replace( | ||
/^\n((?:\|.*?)+\|)[ \t]*\n((?:\|\s*?-{3,}\s*?)+\|)[ \t]*\n((?:(?:\|.*?)+\|[ \t]*\n)*)$/gm, |
Check failure
Code scanning / CodeQL
Inefficient regular expression
|
||
return str | ||
.replace( | ||
/^\n((?:\|.*?)+\|)[ \t]*\n((?:\|\s*?-{3,}\s*?)+\|)[ \t]*\n((?:(?:\|.*?)+\|[ \t]*\n)*)$/gm, |
Check failure
Code scanning / CodeQL
Inefficient regular expression
Codecov Report
@@ Coverage Diff @@
## main #415 +/- ##
=======================================
Coverage 46.35% 46.35%
=======================================
Files 139 139
Lines 11776 11776
=======================================
Hits 5459 5459
Misses 6176 6176
Partials 141 141 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
The description of an issue is now converted to markdown before we
render the description. This is necessary because Jira returns the
description in a wiki markup format, which doesn't look good when it is
directly passed to the ReactMarkdown component for rendering.
We also changed the logic to display the details of an issue, so that
only the fields which are relly available are displayed in the details.
This means if for example an issue doesn't have subtasks we do not
display the subtasks section anymore.
We also changed the color of the status label, so that the label matches
the color in Jira. The previously used color field seems to be
deprecated and Jira only allows 3 status categories. For these
categories we set the color: "Done" -> "green", "In Progress" -> "blue"
and "Open" -> "grey".