-
Notifications
You must be signed in to change notification settings - Fork 12
Markdown support feature for comments #663
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| Copyright (c) 2015-2016, Atlassian Pty Ltd | ||
| All rights reserved. | ||
|
|
||
| Copyright (c) 2016-2018, Vladimir Schneider, | ||
| All rights reserved. | ||
|
|
||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are met: | ||
|
|
||
| * Redistributions of source code must retain the above copyright notice, this | ||
| list of conditions and the following disclaimer. | ||
|
|
||
| * Redistributions in binary form must reproduce the above copyright notice, | ||
| this list of conditions and the following disclaimer in the documentation | ||
| and/or other materials provided with the distribution. | ||
|
|
||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
| FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
| SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
| CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
| OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| flexmark-java | ||
| https://github.com/vsch/flexmark-java | ||
|
|
||
| Copyright (c) 2015-2016, Atlassian Pty Ltd | ||
| Copyright (c) 2016-2018, Vladimir Schneider | ||
|
|
||
| Licensed under the BSD 2-Clause License. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Markdown Comments in Reports | ||
|
|
||
| XLT reports support optional Markdown formatting for test comments. When a comment | ||
| value is prefixed with `::markdown::`, the content after the prefix is converted from | ||
| Markdown to HTML and embedded in the report inside a styled `<div class="markdown">`. | ||
|
|
||
| ## Usage | ||
|
|
||
| Set the comment property in your test configuration: | ||
|
|
||
| ```properties | ||
| # Plain text (unchanged, raw HTML also accepted) | ||
| com.xceptance.xlt.loadtests.comment = This is a plain comment | ||
|
|
||
| # Markdown-formatted comment | ||
| com.xceptance.xlt.loadtests.comment = ::markdown::## Test Run Notes\n\n- **Environment**: staging\n- **Build**: 1.2.3\n- **Duration**: 2 hours | ||
| ``` | ||
|
|
||
| Multiple numbered comments are also supported: | ||
|
|
||
| ```properties | ||
| com.xceptance.xlt.loadtests.comment.1 = ::markdown::## Summary\nAll scenarios passed. | ||
| com.xceptance.xlt.loadtests.comment.2 = ::markdown::## Known Issues\n- Slow DNS on agent 3 | ||
| ``` | ||
|
|
||
| ## Behavior | ||
|
|
||
| | Input | Output | | ||
| |-------|--------| | ||
| | No prefix | Passed through as-is (raw HTML allowed) | | ||
| | `::markdown::` + content | Markdown → HTML, wrapped in `<div class="markdown">` | | ||
| | `::markdown::` only (no content) | Returned unchanged | | ||
| | `null` | Returned as `null` | | ||
|
Comment on lines
+28
to
+33
|
||
|
|
||
| The `::markdown::` prefix is **case-insensitive** — `::Markdown::`, `::MARKDOWN::`, etc. all work. | ||
|
|
||
| ## Supported Markdown Features | ||
|
|
||
| Powered by [flexmark-java](https://github.com/vsch/flexmark-java) with these extensions: | ||
|
|
||
| - **Headings** (`# H1` through `###### H6`) | ||
| - **Bold** / *Italic* / ~~Strikethrough~~ | ||
| - **Lists** (ordered and unordered) | ||
| - **Tables** (GitHub-flavored) | ||
| - **Code** (inline and fenced code blocks) | ||
| - **Blockquotes** | ||
| - **Links** (including auto-linking of URLs) | ||
| - **Horizontal rules** | ||
|
|
||
| ## Styling | ||
|
|
||
| The rendered Markdown is wrapped in `<div class="markdown">` and styled via the report's | ||
| `default.css`. The styles use the report's existing CSS custom properties for consistent | ||
| appearance. Headings, tables, code blocks, blockquotes, and lists are all covered. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -536,6 +536,22 @@ | |
| <artifactId>parboiled-java</artifactId> | ||
| <version>1.4.1</version> | ||
| </dependency> | ||
| <!-- flexmark-java for Markdown-to-HTML conversion (report comments) --> | ||
| <dependency> | ||
| <groupId>com.vladsch.flexmark</groupId> | ||
| <artifactId>flexmark</artifactId> | ||
| <version>0.64.8</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.vladsch.flexmark</groupId> | ||
| <artifactId>flexmark-ext-tables</artifactId> | ||
| <version>0.64.8</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.vladsch.flexmark</groupId> | ||
| <artifactId>flexmark-ext-autolink</artifactId> | ||
| <version>0.64.8</version> | ||
|
Comment on lines
+539
to
+553
|
||
| </dependency> | ||
| <!-- WebSocket-Server needed for running client-performance tests with Chrome and FF --> | ||
| <dependency> | ||
| <groupId>org.glassfish.tyrus</groupId> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These new Markdown styles hardcode colors (
#f0f0f0,#f5f5f5, and elsewhere#666), which may conflict with theming and contradict the doc’s claim that styling uses existing CSS custom properties for consistent appearance. Consider switching these to existing CSS variables (or introduce dedicated variables) so Markdown blocks adapt consistently across themes.