From e237f7ac1ce571e04f86572406fd587319373836 Mon Sep 17 00:00:00 2001 From: CarinaWolli Date: Fri, 3 Mar 2023 15:48:28 -0500 Subject: [PATCH 1/4] fix ul and ol in editor --- apps/web/components/eventtype/EventSetupTab.tsx | 5 ++--- .../getting-started/steps-views/UserProfile.tsx | 5 ++--- apps/web/components/team/screens/Team.tsx | 5 ++--- apps/web/lib/markdownIt.ts | 9 +++++++++ apps/web/pages/[user].tsx | 6 ++---- apps/web/pages/[user]/[type].tsx | 3 ++- apps/web/pages/settings/my-account/profile.tsx | 6 +++--- apps/web/pages/team/[slug].tsx | 4 +--- .../features/ee/teams/pages/team-profile-view.tsx | 5 ++--- .../components/CreateEventTypeDialog.tsx | 12 +++++------- .../eventtypes/components/EventTypeDescription.tsx | 14 +++++++------- .../eventTypeDescriptionParseAndSanitize.ts | 3 +-- packages/ui/components/editor/Editor.tsx | 11 ++++++++++- packages/ui/components/editor/stylesEditor.css | 3 ++- 14 files changed, 50 insertions(+), 41 deletions(-) create mode 100644 apps/web/lib/markdownIt.ts diff --git a/apps/web/components/eventtype/EventSetupTab.tsx b/apps/web/components/eventtype/EventSetupTab.tsx index 9e9f19eaa9a930..7ca6fddd28bf4f 100644 --- a/apps/web/components/eventtype/EventSetupTab.tsx +++ b/apps/web/components/eventtype/EventSetupTab.tsx @@ -1,7 +1,6 @@ import { useAutoAnimate } from "@formkit/auto-animate/react"; import { zodResolver } from "@hookform/resolvers/zod"; import { isValidPhoneNumber } from "libphonenumber-js"; -import MarkdownIt from "markdown-it"; import { Trans } from "next-i18next"; import Link from "next/link"; import type { EventTypeSetupProps, FormValues } from "pages/event-types/[type]"; @@ -19,12 +18,12 @@ import turndown from "@calcom/lib/turndownService"; import { Button, Editor, Label, Select, SettingsToggle, Skeleton, TextField } from "@calcom/ui"; import { FiEdit2, FiCheck, FiX, FiPlus } from "@calcom/ui/components/icon"; +import { md } from "@lib/markdownIt"; + import { EditLocationDialog } from "@components/dialog/EditLocationDialog"; import type { SingleValueLocationOption, LocationOption } from "@components/ui/form/LocationSelect"; import LocationSelect from "@components/ui/form/LocationSelect"; -const md = new MarkdownIt("default", { html: true, breaks: true, linkify: true }); - const getLocationFromType = ( type: EventLocationType["type"], locationOptions: Pick["locationOptions"] diff --git a/apps/web/components/getting-started/steps-views/UserProfile.tsx b/apps/web/components/getting-started/steps-views/UserProfile.tsx index d6c1a5b1d919cf..4e00151bc6a2d0 100644 --- a/apps/web/components/getting-started/steps-views/UserProfile.tsx +++ b/apps/web/components/getting-started/steps-views/UserProfile.tsx @@ -1,5 +1,4 @@ import { ArrowRightIcon } from "@heroicons/react/solid"; -import MarkdownIt from "markdown-it"; import { useRouter } from "next/router"; import type { FormEvent } from "react"; import { useRef, useState } from "react"; @@ -12,9 +11,9 @@ import { trpc } from "@calcom/trpc/react"; import { Button, Editor, ImageUploader, Label, showToast } from "@calcom/ui"; import { Avatar } from "@calcom/ui"; -import type { IOnboardingPageProps } from "../../../pages/getting-started/[[...step]]"; +import { md } from "@lib/markdownIt"; -const md = new MarkdownIt("default", { html: true, breaks: true, linkify: true }); +import type { IOnboardingPageProps } from "../../../pages/getting-started/[[...step]]"; type FormData = { bio: string; diff --git a/apps/web/components/team/screens/Team.tsx b/apps/web/components/team/screens/Team.tsx index f8b245ac9e3210..12dba66c64156c 100644 --- a/apps/web/components/team/screens/Team.tsx +++ b/apps/web/components/team/screens/Team.tsx @@ -1,4 +1,3 @@ -import MarkdownIt from "markdown-it"; import Link from "next/link"; import type { TeamPageProps } from "pages/team/[slug]"; @@ -6,7 +5,7 @@ import { WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Avatar } from "@calcom/ui"; -const md = new MarkdownIt("default", { html: true, breaks: true, linkify: true }); +import { md } from "@lib/markdownIt"; type TeamType = TeamPageProps["team"]; type MembersType = TeamType["members"]; @@ -19,7 +18,7 @@ const Member = ({ member, teamName }: { member: MemberType; teamName: string | n return ( -
+
", "
    ") + .replaceAll("
      ", "
        "); +} diff --git a/apps/web/pages/[user].tsx b/apps/web/pages/[user].tsx index d1993e41d20de8..d136f3ca029b64 100644 --- a/apps/web/pages/[user].tsx +++ b/apps/web/pages/[user].tsx @@ -1,6 +1,5 @@ import { BadgeCheckIcon } from "@heroicons/react/solid"; import classNames from "classnames"; -import MarkdownIt from "markdown-it"; import type { GetServerSidePropsContext } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; @@ -31,13 +30,12 @@ import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { Avatar, AvatarGroup, HeadSeo } from "@calcom/ui"; import { FiArrowRight } from "@calcom/ui/components/icon"; +import { md } from "@lib/markdownIt"; import type { inferSSRProps } from "@lib/types/inferSSRProps"; import type { EmbedProps } from "@lib/withEmbedSsr"; import { ssrInit } from "@server/lib/ssr"; -const md = new MarkdownIt("default", { html: true, breaks: true, linkify: true }); - export default function User(props: inferSSRProps & EmbedProps) { const { users, profile, eventTypes, isDynamicGroup, dynamicNames, dynamicUsernames, isSingleUser } = props; const [user] = users; //To be used when we only have a single user, not dynamic group @@ -147,7 +145,7 @@ export default function User(props: inferSSRProps & E {!isBioEmpty && ( <>
        diff --git a/apps/web/pages/[user]/[type].tsx b/apps/web/pages/[user]/[type].tsx index a96ecf1b2926e3..dbfead8e9d2542 100644 --- a/apps/web/pages/[user]/[type].tsx +++ b/apps/web/pages/[user]/[type].tsx @@ -8,6 +8,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale"; import type { User } from "@calcom/prisma/client"; import { isBrandingHidden } from "@lib/isBrandingHidden"; +import { addListFormatting } from "@lib/markdownIt"; import type { inferSSRProps } from "@lib/types/inferSSRProps"; import type { EmbedProps } from "@lib/withEmbedSsr"; @@ -152,7 +153,7 @@ async function getUserPageProps(context: GetStaticPropsContext) { metadata: EventTypeMetaDataSchema.parse(eventType.metadata || {}), recurringEvent: parseRecurringEvent(eventType.recurringEvent), locations: privacyFilteredLocations(locations), - descriptionAsSafeHTML: eventType.description ? md.render(eventType.description) : null, + descriptionAsSafeHTML: eventType.description ? addListFormatting(md.render(eventType.description)) : null, }); // Check if the user you are logging into has any active teams or premium user name const hasActiveTeam = diff --git a/apps/web/pages/settings/my-account/profile.tsx b/apps/web/pages/settings/my-account/profile.tsx index bda681715eb3ee..7f1837c4f14bb7 100644 --- a/apps/web/pages/settings/my-account/profile.tsx +++ b/apps/web/pages/settings/my-account/profile.tsx @@ -1,6 +1,5 @@ import { IdentityProvider } from "@prisma/client"; import crypto from "crypto"; -import MarkdownIt from "markdown-it"; import { signOut } from "next-auth/react"; import type { BaseSyntheticEvent } from "react"; import { useRef, useState } from "react"; @@ -38,11 +37,11 @@ import { } from "@calcom/ui"; import { FiAlertTriangle, FiTrash2 } from "@calcom/ui/components/icon"; +import { md } from "@lib/markdownIt"; + import TwoFactor from "@components/auth/TwoFactor"; import { UsernameAvailabilityField } from "@components/ui/UsernameAvailability"; -const md = new MarkdownIt("default", { html: true, breaks: true, linkify: true }); - const SkeletonLoader = ({ title, description }: { title: string; description: string }) => { return ( @@ -371,6 +370,7 @@ const ProfileForm = ({ formMethods.setValue("bio", turndown(value), { shouldDirty: true }); }} excludedToolbarItems={["blockType"]} + disableLists />
)}
-
+
diff --git a/packages/features/eventtypes/components/EventTypeDescription.tsx b/packages/features/eventtypes/components/EventTypeDescription.tsx index 757401218ce517..85315825b854a1 100644 --- a/packages/features/eventtypes/components/EventTypeDescription.tsx +++ b/packages/features/eventtypes/components/EventTypeDescription.tsx @@ -1,14 +1,14 @@ -import { Prisma, SchedulingType } from "@prisma/client"; -import MarkdownIt from "markdown-it"; +import type { Prisma } from "@prisma/client"; +import { SchedulingType } from "@prisma/client"; import { useMemo } from "react"; import { FormattedNumber, IntlProvider } from "react-intl"; -import { z } from "zod"; +import type { z } from "zod"; import { classNames, parseRecurringEvent } from "@calcom/lib"; import getPaymentAppData from "@calcom/lib/getPaymentAppData"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { baseEventTypeSelect } from "@calcom/prisma"; -import { EventTypeModel } from "@calcom/prisma/zod"; +import type { baseEventTypeSelect } from "@calcom/prisma"; +import type { EventTypeModel } from "@calcom/prisma/zod"; import { Badge } from "@calcom/ui"; import { FiClock, @@ -20,6 +20,8 @@ import { FiUser, } from "@calcom/ui/components/icon"; +import { md } from "@lib/markdownIt"; + export type EventTypeDescriptionProps = { eventType: Pick< z.infer, @@ -32,8 +34,6 @@ export type EventTypeDescriptionProps = { shortenDescription?: true; }; -const md = new MarkdownIt("default", { html: true, breaks: false, linkify: true }); - export const EventTypeDescription = ({ eventType, className, diff --git a/packages/prisma/middleware/eventTypeDescriptionParseAndSanitize.ts b/packages/prisma/middleware/eventTypeDescriptionParseAndSanitize.ts index 4f21a8873c27e3..05348d1b56293e 100644 --- a/packages/prisma/middleware/eventTypeDescriptionParseAndSanitize.ts +++ b/packages/prisma/middleware/eventTypeDescriptionParseAndSanitize.ts @@ -1,7 +1,6 @@ import type { PrismaClient, EventType } from "@prisma/client"; -import MarkdownIt from "markdown-it"; -const md = new MarkdownIt("default", { html: true, breaks: true, linkify: true }); +import { md } from "@lib/markdownIt"; function parseAndSanitize(description: string) { const parsedMarkdown = md.render(description); diff --git a/packages/ui/components/editor/Editor.tsx b/packages/ui/components/editor/Editor.tsx index 1ae470d3d9c6b2..d66cdeeb9617b7 100644 --- a/packages/ui/components/editor/Editor.tsx +++ b/packages/ui/components/editor/Editor.tsx @@ -31,6 +31,7 @@ export type TextEditorProps = { variables?: string[]; height?: string; placeholder?: string; + disableLists?: boolean; }; const editorConfig = { @@ -74,7 +75,15 @@ export const Editor = (props: TextEditorProps) => { - + { + if (index !== 3 && index !== 4) return value; + }) + : TRANSFORMERS + } + />
diff --git a/packages/ui/components/editor/stylesEditor.css b/packages/ui/components/editor/stylesEditor.css index 65c89ef81e59ad..7a34014110ba8f 100644 --- a/packages/ui/components/editor/stylesEditor.css +++ b/packages/ui/components/editor/stylesEditor.css @@ -26,7 +26,7 @@ text-align: left; border-color: #D1D5DB; border-width: 1px; - padding: 1px + padding: 1px; } .editor-inner { @@ -37,6 +37,7 @@ overflow: scroll; resize: vertical; height: auto; + min-height: 40px; } .editor-input { From fdc5126fe371a670b72fbda824518af4b3de0087 Mon Sep 17 00:00:00 2001 From: CarinaWolli Date: Fri, 3 Mar 2023 16:10:33 -0500 Subject: [PATCH 2/4] fix imports --- apps/web/components/eventtype/EventSetupTab.tsx | 3 +-- .../components/getting-started/steps-views/UserProfile.tsx | 3 +-- apps/web/components/team/screens/Team.tsx | 3 +-- apps/web/pages/[user].tsx | 2 +- apps/web/pages/[user]/[type].tsx | 2 +- apps/web/pages/settings/my-account/profile.tsx | 3 +-- apps/web/pages/team/[slug].tsx | 2 +- packages/features/ee/teams/pages/team-profile-view.tsx | 3 +-- .../eventtypes/components/EventTypeDescription.tsx | 7 +++---- {apps/web => packages}/lib/markdownIt.ts | 7 +++++-- .../middleware/eventTypeDescriptionParseAndSanitize.ts | 2 +- 11 files changed, 17 insertions(+), 20 deletions(-) rename {apps/web => packages}/lib/markdownIt.ts (59%) diff --git a/apps/web/components/eventtype/EventSetupTab.tsx b/apps/web/components/eventtype/EventSetupTab.tsx index 7ca6fddd28bf4f..7b911fbe193f4d 100644 --- a/apps/web/components/eventtype/EventSetupTab.tsx +++ b/apps/web/components/eventtype/EventSetupTab.tsx @@ -13,13 +13,12 @@ import type { EventLocationType } from "@calcom/app-store/locations"; import { getEventLocationType, MeetLocationType, LocationType } from "@calcom/app-store/locations"; import { CAL_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { md } from "@calcom/lib/markdownIt"; import { slugify } from "@calcom/lib/slugify"; import turndown from "@calcom/lib/turndownService"; import { Button, Editor, Label, Select, SettingsToggle, Skeleton, TextField } from "@calcom/ui"; import { FiEdit2, FiCheck, FiX, FiPlus } from "@calcom/ui/components/icon"; -import { md } from "@lib/markdownIt"; - import { EditLocationDialog } from "@components/dialog/EditLocationDialog"; import type { SingleValueLocationOption, LocationOption } from "@components/ui/form/LocationSelect"; import LocationSelect from "@components/ui/form/LocationSelect"; diff --git a/apps/web/components/getting-started/steps-views/UserProfile.tsx b/apps/web/components/getting-started/steps-views/UserProfile.tsx index 4e00151bc6a2d0..db45f9a3f804b2 100644 --- a/apps/web/components/getting-started/steps-views/UserProfile.tsx +++ b/apps/web/components/getting-started/steps-views/UserProfile.tsx @@ -5,14 +5,13 @@ import { useRef, useState } from "react"; import { useForm } from "react-hook-form"; import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { md } from "@calcom/lib/markdownIt"; import { telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry"; import turndown from "@calcom/lib/turndownService"; import { trpc } from "@calcom/trpc/react"; import { Button, Editor, ImageUploader, Label, showToast } from "@calcom/ui"; import { Avatar } from "@calcom/ui"; -import { md } from "@lib/markdownIt"; - import type { IOnboardingPageProps } from "../../../pages/getting-started/[[...step]]"; type FormData = { diff --git a/apps/web/components/team/screens/Team.tsx b/apps/web/components/team/screens/Team.tsx index 12dba66c64156c..0633bae9391f9c 100644 --- a/apps/web/components/team/screens/Team.tsx +++ b/apps/web/components/team/screens/Team.tsx @@ -3,10 +3,9 @@ import type { TeamPageProps } from "pages/team/[slug]"; import { WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { md } from "@calcom/lib/markdownIt"; import { Avatar } from "@calcom/ui"; -import { md } from "@lib/markdownIt"; - type TeamType = TeamPageProps["team"]; type MembersType = TeamType["members"]; type MemberType = MembersType[number]; diff --git a/apps/web/pages/[user].tsx b/apps/web/pages/[user].tsx index d136f3ca029b64..e7045ac8815f71 100644 --- a/apps/web/pages/[user].tsx +++ b/apps/web/pages/[user].tsx @@ -23,6 +23,7 @@ import defaultEvents, { } from "@calcom/lib/defaultEvents"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import useTheme from "@calcom/lib/hooks/useTheme"; +import { md } from "@calcom/lib/markdownIt"; import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry"; import prisma from "@calcom/prisma"; import { baseEventTypeSelect } from "@calcom/prisma/selects"; @@ -30,7 +31,6 @@ import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { Avatar, AvatarGroup, HeadSeo } from "@calcom/ui"; import { FiArrowRight } from "@calcom/ui/components/icon"; -import { md } from "@lib/markdownIt"; import type { inferSSRProps } from "@lib/types/inferSSRProps"; import type { EmbedProps } from "@lib/withEmbedSsr"; diff --git a/apps/web/pages/[user]/[type].tsx b/apps/web/pages/[user]/[type].tsx index dbfead8e9d2542..b0879a49cec5dc 100644 --- a/apps/web/pages/[user]/[type].tsx +++ b/apps/web/pages/[user]/[type].tsx @@ -5,10 +5,10 @@ import type { LocationObject } from "@calcom/app-store/locations"; import { IS_TEAM_BILLING_ENABLED, WEBAPP_URL } from "@calcom/lib/constants"; import hasKeyInMetadata from "@calcom/lib/hasKeyInMetadata"; import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { addListFormatting } from "@calcom/lib/markdownIt"; import type { User } from "@calcom/prisma/client"; import { isBrandingHidden } from "@lib/isBrandingHidden"; -import { addListFormatting } from "@lib/markdownIt"; import type { inferSSRProps } from "@lib/types/inferSSRProps"; import type { EmbedProps } from "@lib/withEmbedSsr"; diff --git a/apps/web/pages/settings/my-account/profile.tsx b/apps/web/pages/settings/my-account/profile.tsx index 7f1837c4f14bb7..5b695688d56f6d 100644 --- a/apps/web/pages/settings/my-account/profile.tsx +++ b/apps/web/pages/settings/my-account/profile.tsx @@ -9,6 +9,7 @@ import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; import { ErrorCode } from "@calcom/lib/auth"; import { APP_NAME } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { md } from "@calcom/lib/markdownIt"; import turndown from "@calcom/lib/turndownService"; import type { TRPCClientErrorLike } from "@calcom/trpc/client"; import { trpc } from "@calcom/trpc/react"; @@ -37,8 +38,6 @@ import { } from "@calcom/ui"; import { FiAlertTriangle, FiTrash2 } from "@calcom/ui/components/icon"; -import { md } from "@lib/markdownIt"; - import TwoFactor from "@components/auth/TwoFactor"; import { UsernameAvailabilityField } from "@components/ui/UsernameAvailability"; diff --git a/apps/web/pages/team/[slug].tsx b/apps/web/pages/team/[slug].tsx index 1c1096c5fca5d5..dae11450d4d248 100644 --- a/apps/web/pages/team/[slug].tsx +++ b/apps/web/pages/team/[slug].tsx @@ -10,13 +10,13 @@ import { CAL_URL } from "@calcom/lib/constants"; import { getPlaceholderAvatar } from "@calcom/lib/getPlaceholderAvatar"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import useTheme from "@calcom/lib/hooks/useTheme"; +import { md } from "@calcom/lib/markdownIt"; import { getTeamWithMembers } from "@calcom/lib/server/queries/teams"; import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry"; import { Avatar, Button, HeadSeo, AvatarGroup } from "@calcom/ui"; import { FiArrowRight } from "@calcom/ui/components/icon"; import { useToggleQuery } from "@lib/hooks/useToggleQuery"; -import { md } from "@lib/markdownIt"; import type { inferSSRProps } from "@lib/types/inferSSRProps"; import Team from "@components/team/screens/Team"; diff --git a/packages/features/ee/teams/pages/team-profile-view.tsx b/packages/features/ee/teams/pages/team-profile-view.tsx index d7a13aca828364..e61d7b633fdd03 100644 --- a/packages/features/ee/teams/pages/team-profile-view.tsx +++ b/packages/features/ee/teams/pages/team-profile-view.tsx @@ -10,6 +10,7 @@ import { z } from "zod"; import { IS_TEAM_BILLING_ENABLED, WEBAPP_URL } from "@calcom/lib/constants"; import { getPlaceholderAvatar } from "@calcom/lib/getPlaceholderAvatar"; import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { md } from "@calcom/lib/markdownIt"; import objectKeys from "@calcom/lib/objectKeys"; import turndown from "@calcom/lib/turndownService"; import { trpc } from "@calcom/trpc/react"; @@ -30,8 +31,6 @@ import { } from "@calcom/ui"; import { FiExternalLink, FiLink, FiTrash2, FiLogOut } from "@calcom/ui/components/icon"; -import { md } from "@lib/markdownIt"; - import { getLayout } from "../../../settings/layouts/SettingsLayout"; const regex = new RegExp("^[a-zA-Z0-9-]*$"); diff --git a/packages/features/eventtypes/components/EventTypeDescription.tsx b/packages/features/eventtypes/components/EventTypeDescription.tsx index 85315825b854a1..37e021430e5ad3 100644 --- a/packages/features/eventtypes/components/EventTypeDescription.tsx +++ b/packages/features/eventtypes/components/EventTypeDescription.tsx @@ -7,6 +7,7 @@ import type { z } from "zod"; import { classNames, parseRecurringEvent } from "@calcom/lib"; import getPaymentAppData from "@calcom/lib/getPaymentAppData"; import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { addListFormatting, md } from "@calcom/lib/markdownIt"; import type { baseEventTypeSelect } from "@calcom/prisma"; import type { EventTypeModel } from "@calcom/prisma/zod"; import { Badge } from "@calcom/ui"; @@ -20,8 +21,6 @@ import { FiUser, } from "@calcom/ui/components/icon"; -import { md } from "@lib/markdownIt"; - export type EventTypeDescriptionProps = { eventType: Pick< z.infer, @@ -59,8 +58,8 @@ export const EventTypeDescription = ({ )} dangerouslySetInnerHTML={{ __html: shortenDescription - ? md.render(eventType.description?.replace(/


<\/p>|\n/g, " ")) - : md.render(eventType.description), + ? addListFormatting(md.render(eventType.description?.replace(/


<\/p>|\n/g, " "))) + : addListFormatting(md.render(eventType.description)), }} /> )} diff --git a/apps/web/lib/markdownIt.ts b/packages/lib/markdownIt.ts similarity index 59% rename from apps/web/lib/markdownIt.ts rename to packages/lib/markdownIt.ts index 5fbc2298217836..45df9a5fdd18f0 100644 --- a/apps/web/lib/markdownIt.ts +++ b/packages/lib/markdownIt.ts @@ -4,6 +4,9 @@ export const md = new MarkdownIt("default", { html: true, breaks: true, linkify: export function addListFormatting(html: string) { return html - .replaceAll("

    ", "
      ") - .replaceAll("
        ", "
          "); + .replaceAll("
            ", "
              ") + .replaceAll( + "
                ", + "
                  " + ); } diff --git a/packages/prisma/middleware/eventTypeDescriptionParseAndSanitize.ts b/packages/prisma/middleware/eventTypeDescriptionParseAndSanitize.ts index 05348d1b56293e..ab561e1f2005a7 100644 --- a/packages/prisma/middleware/eventTypeDescriptionParseAndSanitize.ts +++ b/packages/prisma/middleware/eventTypeDescriptionParseAndSanitize.ts @@ -1,6 +1,6 @@ import type { PrismaClient, EventType } from "@prisma/client"; -import { md } from "@lib/markdownIt"; +import { md } from "@calcom/lib/markdownIt"; function parseAndSanitize(description: string) { const parsedMarkdown = md.render(description); From 088cfc7450dc5eaadd13017edd15905f09d78268 Mon Sep 17 00:00:00 2001 From: CarinaWolli Date: Fri, 3 Mar 2023 16:16:32 -0500 Subject: [PATCH 3/4] disable list for team about section --- packages/features/ee/teams/pages/team-profile-view.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/features/ee/teams/pages/team-profile-view.tsx b/packages/features/ee/teams/pages/team-profile-view.tsx index e61d7b633fdd03..34e7530037359b 100644 --- a/packages/features/ee/teams/pages/team-profile-view.tsx +++ b/packages/features/ee/teams/pages/team-profile-view.tsx @@ -223,6 +223,7 @@ const ProfileView = () => { getText={() => md.render(form.getValues("bio") || "")} setText={(value: string) => form.setValue("bio", turndown(value))} excludedToolbarItems={["blockType"]} + disableLists />

                  {t("team_description")}

                  From 3e568876ec1fe881e5ca403ff5ec145f6cb4f169 Mon Sep 17 00:00:00 2001 From: CarinaWolli Date: Fri, 3 Mar 2023 16:38:25 -0500 Subject: [PATCH 4/4] fix event type description in list --- .../features/eventtypes/components/EventTypeDescription.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/features/eventtypes/components/EventTypeDescription.tsx b/packages/features/eventtypes/components/EventTypeDescription.tsx index 37e021430e5ad3..a89611ba8df3bc 100644 --- a/packages/features/eventtypes/components/EventTypeDescription.tsx +++ b/packages/features/eventtypes/components/EventTypeDescription.tsx @@ -30,7 +30,7 @@ export type EventTypeDescriptionProps = { seatsPerTimeSlot?: number; }; className?: string; - shortenDescription?: true; + shortenDescription?: boolean; }; export const EventTypeDescription = ({ @@ -57,9 +57,7 @@ export const EventTypeDescription = ({ shortenDescription ? "line-clamp-4" : "" )} dangerouslySetInnerHTML={{ - __html: shortenDescription - ? addListFormatting(md.render(eventType.description?.replace(/


                  <\/p>|\n/g, " "))) - : addListFormatting(md.render(eventType.description)), + __html: addListFormatting(md.render(eventType.description)), }} /> )}