docs-util: fix parsing when function if it has three parameters (#10878)
* docs-util: fix parsing when step when it has three parameters * fix condition
This commit is contained in:
1 parent
a0e944a7a8
commit
46f987e351
6 files changed
+106960
-106544
No files matched your search
@@ -3,7 +3,7 @@
|
||||
import { Text } from "@medusajs/ui"
|
||||
import clsx from "clsx"
|
||||
import Link from "next/link"
|
||||
import React from "react"
|
||||
import React, { useMemo } from "react"
|
||||
import { WorkflowStepUi } from "types"
|
||||
import { InlineCode, MarkdownContent, Tooltip } from "../../.."
|
||||
import { Bolt, InformationCircle } from "@medusajs/icons"
|
||||
@@ -15,6 +15,10 @@ export type WorkflowDiagramNodeProps = {
|
||||
export const WorkflowDiagramStepNode = ({ step }: WorkflowDiagramNodeProps) => {
|
||||
const stepId = step.name.split(".").pop()
|
||||
|
||||
const description = useMemo(() => {
|
||||
return step.description?.replaceAll(/:::[a-z]*/g, "") || ""
|
||||
}, [step.description])
|
||||
|
||||
return (
|
||||
<Tooltip
|
||||
tooltipClassName="!text-left max-w-[300px] text-pretty overflow-scroll"
|
||||
@@ -27,12 +31,12 @@ export const WorkflowDiagramStepNode = ({ step }: WorkflowDiagramNodeProps) => {
|
||||
satisfied.
|
||||
</span>
|
||||
)}
|
||||
{step.description && (
|
||||
{description && (
|
||||
<MarkdownContent
|
||||
allowedElements={["a", "strong", "code"]}
|
||||
unwrapDisallowed={true}
|
||||
>
|
||||
{step.description}
|
||||
{description}
|
||||
</MarkdownContent>
|
||||
)}
|
||||
</>
|
||||
|
||||
Reference in new issue
Block a user