Skip to content

Commit

Permalink
FI-2198 Markdown processing added to group level (#399)
Browse files Browse the repository at this point in the history
* Markdown processing added to group level

* Linted changes

* Added canonical link to ensure it is not read as table
  • Loading branch information
360dgries committed Oct 3, 2023
1 parent 7927af2 commit 426ab2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import InputOutputList from './TestListItem/InputOutputList';
import ResultIcon from './ResultIcon';
import TestRunButton from '~/components/TestSuite/TestRunButton/TestRunButton';
import { shouldShowDescription } from '~/components/TestSuite/TestSuiteUtilities';
import remarkGfm from 'remark-gfm';

interface TestGroupCardProps {
children: React.ReactNode;
Expand All @@ -22,7 +23,9 @@ const TestGroupCard: FC<TestGroupCardProps> = ({ children, runnable, runTests, v

// render markdown once on mount - it's too slow with re-rendering
const description = useMemo(() => {
return runnable.description ? <ReactMarkdown>{runnable.description}</ReactMarkdown> : undefined;
return runnable.description ? (
<ReactMarkdown remarkPlugins={[remarkGfm]}>{runnable.description}</ReactMarkdown>
) : undefined;
}, [runnable.description]);

const runnableType = 'tests' in runnable ? RunnableType.TestGroup : RunnableType.TestSuite;
Expand Down
8 changes: 8 additions & 0 deletions dev_suites/dev_demo_ig_stu1/groups/demo_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ class DemoGroup < Inferno::TestGroup
# This is a markdown header
**Inferno** [github](https://github.com/inferno-framework/inferno-core)
Below is a markdown table
| Column 1 | Column 2 | Column 3 |
| :--- | :---: | ---: |
| Entry 1 | Entry 2 | Entry 3|
| Entry 4 | Entry 5 | Entry 6 |
This is a dummy canonical link http://hl7.org/fhir/ValueSet/my-valueset|0.8 that should not be
interpreted as a table
)

# Inputs and outputs
Expand Down

0 comments on commit 426ab2c

Please sign in to comment.